Ruby – How to select some characters from string February 3, 2023 by Tarik Try foo[0...100], any range will do. Ranges can also go negative. It is well explained in the documentation of Ruby.