Product Site

5.1.7.101. wordLength

Returns the length of the nth whitespace-delimited word in the receiving string or 0 if the receiving string has fewer than n words. The n must be a positive whole number.
Example 5.136. String class — wordLength method
"Now is the time"~wordLength(2)       -->    2
"Now comes the time"~wordLength(2)    -->    5
"Now is the time"~wordLength(6)       -->    0