Enter a range to grab a range of characters. : char in string « String « Ruby
- Ruby
- String
- char in string
Enter a range to grab a range of characters.
# Two dots (..) means include the last character:
cite = "this is a test"
cite[0..4]
Related examples in the same category