Skip to content

Instantly share code, notes, and snippets.

@danielpowell4
Created September 11, 2016 07:01
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 danielpowell4/1f0c514a4e9865b31b05524212fb0a58 to your computer and use it in GitHub Desktop.
Save danielpowell4/1f0c514a4e9865b31b05524212fb0a58 to your computer and use it in GitHub Desktop.
Replace letters in string with the letter 13 places after it in the alphabet
def rot13(string)
string.tr("A-Za-z", "N-ZA-Mn-za-m")
end
# More on tr here: http://apidock.com/ruby/String/tr
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment