Sololearn: Learn to Code
New course! Every coder should learn Generative AI!
Try a free lesson
0
string text=" this is what I want to reverse"; string result; for(int i=text.lengh;i>0;i--) {result=result+ text[i];} something like this. I didn't test it yet but basically I just go through my for loop and add the chars of the string text from the last to the first to the new string until everything has been reversed. might still be some minor bugs in the code like using >= instead of > or something
6th Nov 2016, 1:06 PM
Christina Piete
Christina Piete - avatar