Is Delphi's "Contains" register a string helper?

Delphi XE3 introduced the Contains string helper function, but the help / wiki file does not specify if case sensitive or not

+3


source to share


1 answer


Yes, it is case sensitive.

Quick test:

ShowMessage('TEST'.Contains('t').ToString(TUseBoolStrs.True));

      

returns False




Use ToLowerInvariant or ToUpperInvariant to compare case insensitively:

ShowMessage('TEST'.ToLowerInvariant.Contains('t').ToString(TUseBoolStrs.True));

      

+2


source







All Articles