Skip to content

Instantly share code, notes, and snippets.

@cbetta
Created January 12, 2016 10:16
Show Gist options
  • Star 0 You must be signed in to star a gist
  • Fork 0 You must be signed in to fork a gist
  • 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