Kilowatt Software L.L.C.
Classic Rexx Tutorial
Language Level 4.00 (TRL-2)
Wordindex built-in function
The Wordindex function returns the character position of the Nth word in a string.
Words are separated by spaces.
result = Wordindex( string, n )
- a string of space separated words
- index of word to locate. The index must be a positive whole number. When n
exceeds the number of words in the string, 0 is returned.
say Wordindex( 'what is your favorite word?', 5 ) -- shows: 23 (the position of: word?)
say Wordindex( 'what is your favorite word?', 6 ) -- shows: 0
say Wordindex( 'let us not quibble over a word or two', 4 ) -- shows: 12 (the position 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