I need to have my code output the String in reverse order. For example, the output should have "code" return as "edoc". This is what I have done so far.
public String reverseString(String str) {
String res = "";
for (int i = 0; i <= str.length()-1; i++) {
res = res + str.charAt(i);
}
return res;
}
forloop? Is this java, c# or what?forloop.new StringBuilder(mystring).reverse().toString()