method

last

Importance_1
v1.1.6 - Show latest stable - 0 notes - Class: ActiveSupport::CoreExtensions::String::Access
last(limit = 1) public

Returns the last character of the string or the last limit characters.

Examples:

  "hello".last     # => "o"
  "hello".last(2)  # => "lo"
  "hello".last(10) # => "hello"
Show source
Register or log in to add new notes.