Make your own free website on
3.2.32. LASTPOS(needle,haystack[,start])

Searches the string haystack for the string needle, and returns
the position in haystack of the first character in the substring
that matched needle. The search is started from the right side, so
if needle occurs several times, the last occurrence is reported.

If start is specified, the search starts at character number start
in haystack. Note that the standard only states that the search
starts at the startth character. It is not stated whether a match
can partly be to the right of the start position, so some
implementations may differ on that point.

     LASTPOS(‘be’, To be or not to be’)      –>   17
     LASTPOS(‘to’, to be or not to be’, 10)  –>   3
     LASTPOS(‘is’, to be or not to be’)      –>   0
     LASTPOS(‘to’, to be or not to be’, 0)   –>   0