Reverse the string using index | Sololearn: Learn to code for FREE!
New course! Every coder should learn Generative AI!
Try a free lesson
0

Reverse the string using index

Can anyone help me out to reverse the string using index in java

28th Jul 2019, 12:46 PM
ABHISHEK
ABHISHEK - avatar
4 Answers
+ 3
It is better to use StringBuffer or StringBuilder Then append and create String
28th Jul 2019, 11:11 PM
Marina Vasilyova
Marina Vasilyova - avatar
+ 1
create new empty string For loop starting from string length - 1 to 0 in loop get charAt(i) and append it to the new string
28th Jul 2019, 6:59 PM
Michal
Michal - avatar
+ 1
Lol, no martin i know how to reverse a string in python and i start Learning java so don't know how to do
29th Jul 2019, 4:14 AM
ABHISHEK
ABHISHEK - avatar