Substring.StartsWithInvariant Method

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

Whether the text starts with 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 2.5 to 46 times slower than StartsWithAscii due to the operating system's case table. Use StartsWithAscii, if A to Z is enough.

Examples

Accented letters in either case.

uses Substr;

procedure Example;
begin
    Assert(Substring('CAF'#$C9' noir').StartsWithInvariant('caf'#$E9, True));
end;
See Also: Substring.StartsWithAscii, Substring.StartsWithLinguistic, Substring.StartsWithLinguistic