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 57
def last(limit = 1)
if limit == 0
''
elsif limit >= size
self
else
mb_chars[(-limit)..-1].to_s
end
end