/**
Complete the solution so that it reverses
the string passed into it.
'world' => 'dlrow'
**/
public class Kata {
public static String solution(String str) {
// Your code here...
return "";
}
}
practica ejercicios
public class Kata {
public static String solution(String str) {
int len = str.length();
StringBuilder dest = new StringBuilder(len);
for (int i = (len - 1); i >= 0; i--){
dest.append(str.charAt(i));
}
return dest.toString();
}
}