Skip to content

Instantly share code, notes, and snippets.

@PPartisan
Created May 2, 2016 13:24
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 PPartisan/3e63c1e6c2a71adddf21875860be696b to your computer and use it in GitHub Desktop.
Save PPartisan/3e63c1e6c2a71adddf21875860be696b to your computer and use it in GitHub Desktop.
public static char[] reverseCharArray(char[] input){
char[] output = new char[input.length];
char temp;
int index = 0;
for (int i = (output.length - 1); i >= (output.length/2); i--) {
temp = input[i];
output[i] = input[index];
output[index] = temp;
index++;
}
return output;
}
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment