AnsiContainsText
Belongs to : FunctionDescription
The AnsiContainsText function looks for a Needle string in a Haystack string, returning true if it finds it. Otherwise false.
It is a Case insensitive command.
Example code
1 2 3 4 5 6 7 8 9 10 11 12 13 14 15 16 17 |
var haystack : AnsiString; begin haystack := 'The cat sat on the mat'; // Note that AnsiContainsText is case insensitive if AnsiContainsText(haystack, 'THE') then ShowMessage('''THE'' was found') else ShowMessage('''THE'' was not found'); if AnsiContainsText(haystack, 'the') then ShowMessage('''the'' was found') else ShowMessage('''the'' was not found'); end; { 'THE' was found 'the' was found} |