+ 1
How to reverse user input to backward.
How to reverse when some one input is "dave" to "evad" with java.
3 ответов
+ 4
Get the length of string , run a for loop with decreasing value length to 0 ,and use that value as index to print string in reverse order.
+ 1
Even better...
String text = "dave";
String reversed = new StringBuilder(text).reverse().toString();
https://docs.oracle.com/en/java/javase/15/docs/api/java.base/java/lang/StringBuilder.html#reverse()
0
Good to know .