Created
January 12, 2016 10:16
-
-
Save cbetta/544e6b3fcb2997500229 to your computer and use it in GitHub Desktop.
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
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