instance method
grapheme_length
Ruby on Rails 4.0.13
Since v4.0.13Signature
grapheme_length()
Returns the number of grapheme clusters in the string.
'क्षि'.mb_chars.length # => 4 'क्षि'.mb_chars.grapheme_length # => 3
Source
# File activesupport/lib/active_support/multibyte/chars.rb, line 180
def grapheme_length
Unicode.unpack_graphemes(@wrapped_string).length
end
Defined in activesupport/lib/active_support/multibyte/chars.rb line 180
· View on GitHub
· Improve this page
· Find usages on GitHub
Defined in ActiveSupport::Multibyte::Chars