Skip to main content

split

_.split(separator, string) # Ⓢ [Ⓣ][1] Ⓝ

Splits string by separator.





Note: This method is based on



String#split.

Since​

4.0.0

Arguments​

  1. separator (RegExp|string): The separator pattern to split by.
  2. string (string): The string to split.

Returns​

(Array): Returns the string segments.

Example​

_.split(['-', 2], 'a-b-c');
// => ['a', 'b']