instance method
=~
Ruby on Rails 3.0.20
Since v2.2.3 Last seen in v3.2.22.5Signature
=~(other)
Like String#=~ only it returns the character offset (in codepoints) instead of the byte offset.
Example:
'Café périferôl'.mb_chars =~ /ô/ # => 12
Parameters
-
otherreq
Source
# File activesupport/lib/active_support/multibyte/chars.rb, line 116
def =~(other)
translate_offset(@wrapped_string =~ other)
end
Defined in activesupport/lib/active_support/multibyte/chars.rb line 116
· View on GitHub
· Improve this page
· Find usages on GitHub
Defined in ActiveSupport::Multibyte::Chars