The Words function returns the number of words in a string. Words are separated by spaces. Punctuation characters may adversely affect the resulting count.
result = Words( string ) |
Examples:
say Words( 'what is your favorite word?' ) -- shows: 5 say Words( 'let us not quibble over a word or two' ) -- shows: 9 say Words( ' ' ) -- shows: 0 say Words( 'Here is a magic word -- shazam' ) -- shows: 7 (the hyphens are counted as a word) |
Click here to see how the words within a string can be assigned to a set of compound variables.