instance method
reverse
Ruby on Rails 5.2.8.1
Since v2.2.3Signature
reverse()
Reverses all characters in the string.
'Café'.mb_chars.reverse.to_s # => 'éfaC'
Source
# File activesupport/lib/active_support/multibyte/chars.rb, line 111
def reverse
chars(Unicode.unpack_graphemes(@wrapped_string).reverse.flatten.pack("U*"))
end
Defined in activesupport/lib/active_support/multibyte/chars.rb line 111
· View on GitHub
· Improve this page
· Find usages on GitHub
Defined in ActiveSupport::Multibyte::Chars