string.nthWord
| Syntax |
string.nthWord (string, index)
|
| Params |
string is the string from which you wish to extract a word. index is a number indicating the 1-based index position of the word within string you wish to extract.
|
| Action |
Extracts from string the single word at position index with words defined as strings of characters delimited by the current wordChar.
|
| Returns |
The indicated word.
|
| Examples |
string.nthWord ("Eat a good lunch!", 3) » good
string.nthWord ("Coming-into-being is here.", 3)
Note that the terminating punctuation is included in the return value.
Note that the internal punctuation prior to wordChar is included in the return value.
This example returns the empty string because index is larger than the number of words in string, which in this case is 5 (see "Notes," below).
Note that since the period is the word delimiter, it is not considered trailing punctuation and is therefore not part of the word. |
| Notes |
If index < 1, or if index > the number of words in string, this verb returns the empty string.
|
| See Also |
string.nthField
|