- :block
- or :nothing
split
split collection to components
Parameters
split collection :string :literal :block
Attributes
words | split string by whitespace | |
lines | split string by lines | |
by | :string, :regex, :block | split using given separator |
at | :integer | split collection at given position |
every | :integer | split collection every *n* elements |
path | split path components in string |
Returns
Examples
copysplit "hello" ; => [`h` `e` `l` `l` `o`]
copysplit.words "hello world" ; => ["hello" "world"]
copysplit.every: 2 "helloworld" ; => ["he" "ll" "ow" "or" "ld"]
copysplit.at: 4 "helloworld" ; => ["hell" "oworld"]
copyarr: 1..9 split.at:3 'arr ; => [ [1 2 3 4] [5 6 7 8 9] ]