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 : char in string « String « Ruby
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
line = "A horse! a horse! my kingdom for a horse!"
puts line[18, 23]
# You started at index location 18, and then scooped up 23 characters from there, inclusive.