|
Last change
on this file since a762898 was a762898, checked in by istevanoska <ilinastevanoska@…>, 5 months ago |
|
Added visualizations
|
-
Property mode
set to
100644
|
|
File size:
593 bytes
|
| Line | |
|---|
| 1 | /**
|
|---|
| 2 | * Splits `string` into an array of its words, treating spaces and punctuation marks as separators.
|
|---|
| 3 | *
|
|---|
| 4 | * @param {string} str The string to inspect.
|
|---|
| 5 | * @param {RegExp | string} [pattern] The pattern to match words.
|
|---|
| 6 | * @returns {string[]} Returns the words of `string`.
|
|---|
| 7 | *
|
|---|
| 8 | * @example
|
|---|
| 9 | * words('fred, barney, & pebbles');
|
|---|
| 10 | * // => ['fred', 'barney', 'pebbles']
|
|---|
| 11 | *
|
|---|
| 12 | * words('camelCaseHTTPRequest🚀');
|
|---|
| 13 | * // => ['camel', 'Case', 'HTTP', 'Request', '🚀']
|
|---|
| 14 | *
|
|---|
| 15 | * words('Lunedì 18 Set')
|
|---|
| 16 | * // => ['Lunedì', '18', 'Set']
|
|---|
| 17 | */
|
|---|
| 18 | declare function words(str: string): string[];
|
|---|
| 19 |
|
|---|
| 20 | export { words };
|
|---|
Note:
See
TracBrowser
for help on using the repository browser.