string.lastWord
| Syntax |
string.lastWord (string)
|
| Params |
string is the string from which you wish to extract the last word.
|
| Action |
Extracts the last word from string. A word is defined as a string of characters terminated by the character currently defined as the wordChar. The last word is therefore the last string of characters in string following the last occurrence of wordChar.
|
| Returns |
The resulting string.
|
| Examples |
string.lastWord ("Eat a good lunch!") » lunch!
Note that the ending punctuation is included with string.lastWord. This example assumes wordChar is a space.
string.setWordChar ("-");
string.setWordChar ("");
|
| Notes |
The string returned by string.lastWord does not include the preceding word delimiter but does include any trailing punctuation.
|
| See Also |
string.firstWord
|