Last active
August 29, 2015 14:00
-
-
Save sharnie/984bbe5a3d5c8f582a3a to your computer and use it in GitHub Desktop.
replace characters with ASCII code
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
"sharnie".each_char do |char| | |
puts char.ord-97 # 97 specify where to start on the ascii table | |
end |
Sign up for free
to join this conversation on GitHub.
Already have an account?
Sign in to comment