string.nthWord ("Eat a good lunch!", 3)
» good
string.nthWord ("Coming-into-being is here.", 3)
» here.
Note that the terminating punctuation is included in the return value.
string.nthWord ("Coming-into-being is, at last, here.", 4)
» last,
Note that the internal punctuation prior to wordChar is included in the return value.
string.nthWord ("Programming after midnight is normal.", 99)
» ""
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).
ch = string.getWordChar ();
string.setWordChar ('.');
word = string.nthWord ("people.DW.notepad", 2);
string.setWordChar (ch);
word
DW
Note that since the period is the word delimiter, it is not considered trailing punctuation and is therefore not part of the word.