String These are things that contain text-based information.
This ability to cross
string can be extremely useful.
We have been assigned to solve the problem using string traversal. Create a new string with the characters reversed
The first known problem is that the text of the poem is inverted. Declare a new, empty String to store the reversed text. Create a for loop that will iterate through every value of our String. Inside the loop, grab a single element at the String index of the current iteration. Also within the loop, update the new String by prepending the current element’s value to the current String value. Return the new String once the loop is complete.