split has default behaviour with no delimiter present
This commit is contained in:
1 parent
020866c0e9
commit
183dd0293b
3 files changed
+27
-9
No files matched your search
@@ -155,12 +155,14 @@ join('-','foo') => foo
|
||||
join('-', 'foo', 'bar') => foo-bar
|
||||
</pre>
|
||||
|
||||
### `split(delim, expr)`
|
||||
### `split(delim?, expr)`
|
||||
|
||||
Splits a string undr `expr` by `delim` which can be a regular expression
|
||||
Splits a string under `expr` by `delim` which can be a regular expression. If no delimiter is specified, it splits
|
||||
by characters.
|
||||
|
||||
<pre>
|
||||
split('',foo) => [f, o, o]
|
||||
split('foo') => [f, o, o]
|
||||
split('','foo') => [f, o, o]
|
||||
split('.','foo.bar') => []
|
||||
split('\\.','foo.bar') => [foo, bar]
|
||||
</pre>
|
||||
|
||||
Reference in new issue
Block a user