split

v0.9.6arrow_drop_down
v0.9.6
STATUS
Passing
DOWNLOADS
2
VISIBILITY
Public
PUBLISHED
5 years ago
SIZE
4 KB
Splits a string into an array of strings based on the given separator.
1 contributor
Install split as a package?
Copied
npm i @bit/justin-capalbo.ramda.split
Set Bit as a scoped registryLearn more
npm config set '@bit:registry' https://node.bit.cloud
Component Example
React
React
Vue
Angular
React Native
Add dependency... help_outline
Just
import
any of the 1 million components
and packages in Bit or NPM to the example.
import Button from '@bit/grommet.grommet.button';
import Lodash from 'lodash';
toggle layout
No preview available
modifieddraft
chevron_left
chevron_right
split (
sep:(String | RegExp),
str:String
) : Array

Splits a string into an array of strings based on the given separator.

Example
const pathComponents = R.split('/');
     R.tail(pathComponents('/usr/local/bin/node')); //=> ['usr', 'local', 'bin', 'node']

     R.split('.', 'a.b.c.xyz.d'); //=> ['a', 'b', 'c', 'xyz', 'd']
Arguments
sep: (String | RegExp)

The pattern.

str: String

The string to separate into an array.

Returns
Array

The array of strings from `str` separated by `str`.

Help and resources