I need to reverse the string of a user\'s input.
I need it done in the simplest of ways. I was trying to do reverseOrder(UserInput) but it wasn\'t working.
If you are new to programming, which I guess you are, my suggestion is "Why use simple stuff?". Understand the internals and play some!!
public static void main(String[] args) {
String str = "abcasz";
char[] orgArr = str.toCharArray();
char[] revArr = new char[orgArr.length];
for (int i = 0; i < orgArr.length;i++) {
revArr[i] = orgArr[orgArr.length - 1 - i];
}
String revStr = new String(revArr);
System.out.println(revStr);