last(limit = 1)
public
Returns the last
character of the string or the last
limit characters.
Examples:
"hello".last
"hello".last(2)
"hello".last(10)
# File activesupport/lib/active_support/core_ext/string/access.rb, line 52
def last(limit = 1)
self[(-limit)..-1] || self
end