words
Modified on Wed, 02 Aug 2023
Description
Split string into an array of its words. A word character is a letter, a number, or an underscore.
Syntax
words(text, pattern)
Parameters
Input Parameter | Type | Description |
---|---|---|
text | string | The string to inspect. |
pattern (optional) | string | The pattern to match words. |
Return value
Type |
---|
Array |
Sample
Example | Result | Description |
---|---|---|
words('fred, barney, & pebbles'); | ['fred', 'barney', 'pebbles'] | Returns the words of a text |
To view all the String functions, click here.
Was this article helpful?
That’s Great!
Thank you for your feedback
Sorry! We couldn't be helpful
Thank you for your feedback
Feedback sent
We appreciate your effort and will try to fix the article