Mega Code Archive
Use an offset and length (two Fixnums) to tell [] the index location where you want to start, and then how many characters you want
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.