1 var toString = require('./toString');
4 * Splits `string` by `separator`.
6 * **Note:** This method is based on [`String#split`](https://mdn.io/String/split).
11 * @param {string} [string=''] The string to split.
12 * @param {RegExp|string} separator The separator pattern to split by.
13 * @param {number} [limit] The length to truncate results to.
14 * @returns {Array} Returns the new array of string segments.
17 * _.split('a-b-c', '-', 2);
20 function split(string, separator, limit) {
21 return toString(string).split(separator, limit);
24 module.exports = split;