Skip to content

Instantly share code, notes, and snippets.

@quotha
Created April 25, 2014 16:48
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 quotha/11295942 to your computer and use it in GitHub Desktop.
Save quotha/11295942 to your computer and use it in GitHub Desktop.
Reverse a string
def reverse_string front, back=""
if front.size > 1
reverse_string front[0..front.size-2], (back + front[front.size-1])
else
back + front
end
end
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment