|
Last change
on this file was a762898, checked in by istevanoska <ilinastevanoska@…>, 5 months ago |
|
Added visualizations
|
-
Property mode
set to
100644
|
|
File size:
1.2 KB
|
| Line | |
|---|
| 1 | /**
|
|---|
| 2 | * Splits the input string by the specified `separator`
|
|---|
| 3 | * and returns a new array containing the split segments.
|
|---|
| 4 | *
|
|---|
| 5 | * @param {string | null | undefined} [string=''] The string to split.
|
|---|
| 6 | * @param {RegExp|string} [separator] The separator pattern to split by.
|
|---|
| 7 | * @param {number} [limit] The length to truncate results to.
|
|---|
| 8 | * @returns {Array} Returns the string segments.
|
|---|
| 9 | *
|
|---|
| 10 | * @example
|
|---|
| 11 | * split('a-b-c', '-');
|
|---|
| 12 | * // => ['a', 'b', 'c']
|
|---|
| 13 | *
|
|---|
| 14 | * split('a-b-c', '-', 2);
|
|---|
| 15 | * // => ['a', 'b']
|
|---|
| 16 | */
|
|---|
| 17 | declare function split(string: string | null | undefined, separator?: RegExp | string, limit?: number): string[];
|
|---|
| 18 | /**
|
|---|
| 19 | * Splits the input string by the specified `separator`
|
|---|
| 20 | * and returns a new array containing the split segments.
|
|---|
| 21 | *
|
|---|
| 22 | * @param {string | null | undefined} [string=''] The string to split.
|
|---|
| 23 | * @param {RegExp|string} [separator] The separator pattern to split by.
|
|---|
| 24 | * @param {number} [limit] The length to truncate results to.
|
|---|
| 25 | * @returns {Array} Returns the string segments.
|
|---|
| 26 | *
|
|---|
| 27 | * @example
|
|---|
| 28 | * split('a-b-c', '-');
|
|---|
| 29 | * // => ['a', 'b', 'c']
|
|---|
| 30 | *
|
|---|
| 31 | * split('a-b-c', '-', 2);
|
|---|
| 32 | * // => ['a', 'b']
|
|---|
| 33 | */
|
|---|
| 34 | declare function split(string: string | null | undefined, index: string | number, guard: object): string[];
|
|---|
| 35 |
|
|---|
| 36 | export { split };
|
|---|
Note:
See
TracBrowser
for help on using the repository browser.