split

split :: (String | RegExp pattern, String input) -> Array

description

Splits a string using a string or regular expression pattern into an array of items.

examples

using a string pattern

import { split } from 'conductor'

split(', ', 'Bonsoir, Elliot') // ['Bonsoir', 'Elliot']

using a regular expression pattern

import { split } from 'conductor'

split(/,\s/, 'Bonsoir, Elliot') // ['Bonsoir', 'Elliot']

Last updated