instance method from

Ruby on Rails 2.2.3

Last seen in v2.3.18

Available in: v2.2.3 v2.3.18

Signature

from(position)

Returns the remaining of the string from the position treating the string as an array (where 0 is the first character).

Examples:

"hello".from(0)  # => "hello"
"hello".from(2)  # => "llo"
"hello".from(10) # => nil

Parameters

position req
Source
# File activesupport/lib/active_support/core_ext/string/access.rb, line 23
          def from(position)
            mb_chars[position..-1].to_s
          end

Defined in activesupport/lib/active_support/core_ext/string/access.rb line 23 · View on GitHub · Improve this page · Find usages on GitHub

Defined in ActiveSupport::CoreExtensions::String::Access

Type at least 2 characters to search.

Use the arrow keys to navigate results, Enter to open one, Escape to close.

Keyboard shortcuts

/
Focus search
⌘K / Ctrl-K
Command palette
?
This help
Esc
Close