If you add the chr method from the Integer class, you'll get the actual character: : char in string « String « Ruby
char in string
If you add the chr method from the Integer class, you'll get the actual character:
"A horse! a horse! my kingdom for a horse!"
.chr # =>
Related examples in the same category
Map chars in a string
specify a Fixnum (integer) as an index, it returns the decimal character code for the character found at the index location
Use string as array
Change a string with offset
taking the first letter from a string
use an offset and length (two Fixnums) to tell  the index location where you want to start, and then how many characters you want to retrieve
Enter a range to grab a range of characters.
use regular expressions
Adding another argument, a Fixnum, returns that portion of the matched data, starting at 0 in this instance
Concatenate string by string index
Loop through a string with while
Copyright 2009 - 12 Demo Source and Support. All rights reserved.
All other trademarks are property of their respective owners.