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.