This function searches the first occurrence of a substring in a string. The search can be performed either case sensitive or case insensitive.
ASSIGN offset := search_first (haystack; needle; case_sensitive)
The result of the function search_first is of type NUMBER. This function has three parameters:
The result of the function search_first is the offset of the first occurrence of the parameter needle in the parameter haystack. 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 function search_first 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_first ("The Quick Brown Fox Jumps Over The Lazy Dog"; "o"; FALSE)
Result: 13.