Substring.StartsWithLinguistic Method

Overload List

#SignatureDescription
1function StartsWithLinguistic(const Value: string; const IgnoreCase: Boolean): Boolean; overload;Whether the text starts with Value by the rules of the default locale or of LocaleID; IgnoreCase True ignores case.
2function StartsWithLinguistic(const Value: string; const IgnoreCase: Boolean; const LocaleID: TLocaleID): Boolean; overload;

Overload 1: function StartsWithLinguistic(const Value: string; const IgnoreCase: Boolean): Boolean; overload;

Whether the text starts with Value by the rules of the default locale or of LocaleID; IgnoreCase True ignores case.

#NameTypeDescription
1Valuestring
2IgnoreCaseBoolean

Returns: Boolean

Remarks:

Every text kind. A Value of only ignorable characters, such as a soft hyphen, is a match, as an empty one is. Note: This routine is 5.4 to 91 times slower than StartsWithAscii, and 15 to 239 times slower than StartsWith, due to handling of the locale specific char handling. Use StartsWithAscii or StartsWith, if this handling is not needed.

Examples

A soft hyphen in the text is ignored.

uses Substr;

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

Overload 2: function StartsWithLinguistic(const Value: string; const IgnoreCase: Boolean; const LocaleID: TLocaleID): Boolean; overload;

#NameTypeDescription
1Valuestring
2IgnoreCaseBoolean
3LocaleIDTLocaleID

Returns: Boolean