Kilowatt Software L.L.C.
Classic Rexx Tutorial
Language Level 4.00 (TRL-2)
Wordlength built-in function
The Wordlength function returns the length of the Nth word in a string.
Words are separated by spaces.
result = Wordlength( string, n )
- a string of space separated words
- index of word whose length is returned. The index must be a positive whole number. When n
exceeds the number of words in the string, 0 is returned.
say Wordlength( 'what is your favorite word?', 5 ) -- shows: 5 (the length of: word?)
say Wordlength( 'what is your favorite word?', 6 ) -- shows: 0
say Wordlength( 'let us not quibble over a word or two', 4 ) -- shows: 7 (the length of: quibble)
Kilowatt Software L.L.C. -- Classic Rexx Tutorial -- Back to top
Click here if you have any comments or questions regarding this tutorial
Last updated on: 11 Apr 2006