class String

def from(position)

Experimental RBS support (using type sampling data from the type_fusion project).

def from: (Integer position) -> String

This signature was generated using 6 samples from 1 application.

str.from(1).to(-2) # => "ell"
str.from(0).to(-1) # => "hello"
str = "hello"

You can mix it with +to+ method and do fun things like:

str.from(-2) # => "lo"
str.from(3) # => "lo"
str.from(0) # => "hello"
str = "hello"

If the position is negative, it is counted from the end of the string.
Returns a substring from the given position to the end of the string.
def from(position)
  self[position, length]
end