instance method
unpack_graphemes
Ruby on Rails 6.0.6
Since v4.0.13 Last seen in v6.0.6Signature
unpack_graphemes(string)
Unpack the string at grapheme boundaries. Returns a list of character lists.
Unicode.unpack_graphemes('क्षि') # => [[2325, 2381], [2359], [2367]] Unicode.unpack_graphemes('Café') # => [[67], [97], [102], [233]]
Parameters
-
stringreq
Source
# File activesupport/lib/active_support/multibyte/unicode.rb, line 36
def unpack_graphemes(string)
ActiveSupport::Deprecation.warn(<<-MSG.squish)
ActiveSupport::Multibyte::Unicode#unpack_graphemes is deprecated and will be
removed from Rails 6.1. Use string.scan(/\X/).map(&:codepoints) instead.
MSG
string.scan(/\X/).map(&:codepoints)
end
Defined in activesupport/lib/active_support/multibyte/unicode.rb line 36
· View on GitHub
· Improve this page
· Find usages on GitHub
Defined in ActiveSupport::Multibyte::Unicode