Xbasic
CONTAINS Function
Syntax
Result_Flag as L = CONTAINS(C String,C Words)
Arguments
- String
The target to examine, a character string containing words separated by space characters.
- Words
A character string containing words separated by space characters. The words to find in the target string.
Description
Returns TRUE if the string contains all the words (case sensitive).
Discussion
CONTAINS() returns .T. (TRUE) if all words in the Find_Words string appear at least once in the Search_String ; otherwise, it returns .F. (FALSE). Words found in memo fields will be highlighted. Find_Words can contain wildcard characters (* and ? ).
Example
contains("now is the time for all good men", "now all is women") -> .F. because the word "women" does not appear in the first string contains("now is the time for all good men", "now all is Men") -> .F. because the word "Men" is different from "men" contains("now is the time for all good men", "now all is ") -> .T.
Limitations
The Find_Words argument is case sensitive.
See Also