s = "hello" # a single index gives a one-character string puts s[0] # [start, length] gives a substring puts s[1, 3]
[i] and [start, length]