Dividing strings by things
class String
alias / split
end
And now:
>> "1,2,3" / ?, # => ["1", "2", "3"]
>> "1, 2 , 3" / /\s*,\s*/ # => ["1", "2", "3"]
Written by Florian Frank
Related protips
Have a fresh tip? Share with Coderwall community!
Post
Post a tip
Best
#Ruby
Authors
Related Tags
#ruby
Sponsored by #native_company# — Learn More
#native_title#
#native_desc#