This function searches a string from a specified location to the next occurrence of a substring. The search can be performed either case sensitive or case insensitive.
ASSIGN offset := search (haystack; needle; start; case_sensitive)
The result of the function search is of type NUMBER. This function has four parameters:
The result of the function search is the offset of the first occurrence of the parameter needle in the parameter haystack at or past the start offset. If the text could not be found the function search returns 0.
Case insensitive searches are performed by converting both the parameters haystack and the needle to lower case before performing the search.
The search function is designed to handle Unicode input. Non-printable word processor instructions are ignored, similar to the behavior of the function fragment_of_characters.
Example
search ("The Quick Brown Fox Jumps Over The Lazy Dog"; "o"; 20; FALSE)
Result: 27 (the "O" in "Over")