Skip to content

Instantly share code, notes, and snippets.

@xander-miller
Last active December 3, 2015 21:32
Show Gist options
  • Save xander-miller/ea885f8bf5978a8d8ff6 to your computer and use it in GitHub Desktop.
Save xander-miller/ea885f8bf5978a8d8ff6 to your computer and use it in GitHub Desktop.
Rewriting the string reverse method.
def reversi str = ""
out = ''
1.upto str.length do |i|
out << str.chars[-i]
end
out
end
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment