|
caselessWordPos
>>-caselessWordPos(phrase-+--------+-)---------------------------------><
+-,start-+
Returns the word number of the first word of
[phrase]
found in the
receiving string, or By default the search starts at the first word in the receiving string. You can override this by specifying [start] (which must be positive), the word at which the search is to be started. String class - caselessWordPos method
"now is the time"~caselessWordPos("the") -> 3
"now is the time"~caselessWordPos("The") -> 3
"now is the time"~caselessWordPos("IS THE") -> 2
"now is the time"~caselessWordPos("is the") -> 2
"now is the time"~caselessWordPos("is time ") -> 0
"To be or not to be"~caselessWordPos("BE") -> 2
"To be or not to be"~caselessWordPos("BE",3) -> 6
|