@newdash/newdash
Version:
javascript/typescript utility library
22 lines (21 loc) • 558 B
TypeScript
/**
* Splits `string` by `separator`.
*
* **Note:** This method is based on
* [`String#split`](https://mdn.io/String/split).
*
* @since 5.0.0
* @category String
* @param str The string to split.
* @param separator The separator pattern to split by.
* @param limit The length to truncate results to.
* @returns Returns the string segments.
* @example
*
* ```js
* split('a-b-c', '-', 2)
* // => ['a', 'b']
* ```
*/
export declare function split(str?: string, separator?: RegExp | string, limit?: number): Array<string>;
export default split;