Getting the Parts of a String You Want
s = 'My kingdom for a string!' s.slice(3,7) # => "kingdom" s[3,7] # => "kingdom" s[0,3] # => "My " s[11, 5] # => "for a" s[11, 17] # => "for a string!"