Sha256: 7e6d009004f15c919013e9779ba2694e8e213f892979b9e50dbe2ff0d75a9689

Contents?: true

Size: 350 Bytes

Versions: 13

Compression:

Stored size: 350 Bytes

Contents

Split a comma separated String into an Array:

    parts = "foo,bar,baz,qux".split(',')

Split a comma separated String, but only into three parts:

    a,b,c = "foo,bar,baz,qux".split(',',3)
    # => ["foo", "bar", "baz,qux"]

Split a comma separated String, but only capture the first and third fields:

    a,_,c,_ = "foo,bar,baz,qux".split(',')

Version data entries

13 entries across 13 versions & 1 rubygems

Version Path
ronin-2.1.0 data/tips/ruby/string_split.txt
ronin-2.1.0.rc1 data/tips/ruby/string_split.txt
ronin-2.0.5 data/tips/ruby/string_split.txt
ronin-2.0.4 data/tips/ruby/string_split.txt
ronin-2.0.3 data/tips/ruby/string_split.txt
ronin-2.0.2 data/tips/ruby/string_split.txt
ronin-2.0.1 data/tips/ruby/string_split.txt
ronin-2.0.0 data/tips/ruby/string_split.txt
ronin-2.0.0.beta5 data/tips/ruby/string_split.txt
ronin-2.0.0.beta4 data/tips/ruby/string_split.txt
ronin-2.0.0.beta3 data/tips/ruby/string_split.txt
ronin-2.0.0.beta2 data/tips/ruby/string_split.txt
ronin-2.0.0.beta1 data/tips/ruby/string_split.txt