Skip to content

Instantly share code, notes, and snippets.

@cbetta
Created January 12, 2016 10:16
Show Gist options
  • Save cbetta/544e6b3fcb2997500229 to your computer and use it in GitHub Desktop.
Save cbetta/544e6b3fcb2997500229 to your computer and use it in GitHub Desktop.
public static String reverse(String input) {
String output = "";
while(input.length() > 0) {
output += input.substring(input.length()-1);
input = input.substring(0, input.length() - 1);
}
return output;
}
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment