Make your own free website on Tripod.com
3.2.63. WORDPOS(phrase,string[,start])

Returns the word number in string which indicates at which phrase
begins, provided that phrase is a subphrase of string. If not, 0
is returned to indicate that the phrase was not found. A phrase
differs from a substring in one significant way; a phrase is a set
of words, separated by any number of blanks.

For instance, “is  a” is a subphrase of  “This is a phrase”.
Notice the different amount of whitespace between “is” and “a”.

If start is specified, it sets the word in string at which the
search starts. The default value for start is 1.

     WORDPOS(‘or not’, ‘to be or not to be’) –>   ‘3’
     WORDPOS(‘not to’, ‘to be or not to be’) –>   ‘4’
     WORDPOS(‘to be’, ‘to be or not to be’)  –>   ‘1’
     WORDPOS(‘to be’, ‘to be or not to be’, 3)    –>   ‘6’



PREV NEXT