Method: String#from
- Defined in:
- lib/jun/active_support/core_ext/string/access.rb
#from(position) ⇒ Object
Returns a substring from the given position (index) to the end of the string. If the position is negative, the starting point is counted from the end of the string.
string = "smoki"
string.from(0) # => "smoki"
string.from(3) # => "ki"
string.from(-2) # => "ki"
25 26 27 |
# File 'lib/jun/active_support/core_ext/string/access.rb', line 25 def from(position) self[position, length] end |