?a # => 97 ?\n # => 10
// string to integer: use []
'a'[0] # => 97 'hallo'[1] # => 97
// integer / number to character: use .chr
97.chr # => "a" 10.chr # => "\n"
//more info: "Ruby Cookbook", O'Reilly
11381 users tagging and storing useful source code snippets
Snippets is a public source code repository. Easily build up your personal collection of code snippets, categorize them with tags / keywords, and share them with the world
?a # => 97 ?\n # => 10
'a'[0] # => 97 'hallo'[1] # => 97
97.chr # => "a" 10.chr # => "\n"
You need to create an account or log in to post comments to this site.