instance method
split
Ruby on Rails 3.1.12
Since v2.2.3Signature
split(*args)
Works just like String#split, with the exception that the items in the resulting list are Chars instances instead of String. This makes chaining methods easier.
Example:
'Café périferôl'.mb_chars.split(/é/).map { |part| part.upcase.to_s } # => ["CAF", " P", "RIFERÔL"]
Parameters
-
argsrest
Source
# File activesupport/lib/active_support/multibyte/chars.rb, line 249
def split(*args)
@wrapped_string.split(*args).map { |i| i.mb_chars }
end
Defined in activesupport/lib/active_support/multibyte/chars.rb line 249
· View on GitHub
· Improve this page
· Find usages on GitHub
Defined in ActiveSupport::Multibyte::Chars