Substring.ContainsInvariant Method

function ContainsInvariant(const Value: string; const IgnoreCase: Boolean): Boolean; overload;

Whether the text contains Value by UTF-16 code unit; IgnoreCase True ignores case by the operating system's uppercase table, the same under every locale.

#NameTypeDescription
1Valuestring
2IgnoreCaseBoolean

Returns: Boolean

Remarks:

Every text kind.
Note: This routine is 4.2 to 24 times slower than ContainsAscii due to the operating system's case table. Use ContainsAscii, if A to Z is enough.

Examples

Accented letters in either case.

uses Substr;

procedure Example;
begin
    Assert(Substring('AB'#$C9'D').ContainsInvariant('b'#$E9, True));
end;
See Also: Substring.ContainsAscii, Substring.ContainsLinguistic, Substring.ContainsLinguistic