Operator Scope of Action:
Operator First Added:
Operator Last Altered:
returns the first number words of a string. If the string has fewer than wordsNum words, returns the entire string. If wordsNum is negative, it returns a negative -wordsNum words from the end of the string. If $MyString is "Romans, they go house?".
$MyString = $MyString.words(2);
returns "Romans, they".
$MyString = $MyString.words(-1);
returns "house?". Note that punctuation contiguous to words gets passed through as part of the returned word(s).