Substring.CompareLinguistic Method

Overload List

#SignatureDescription
1class function CompareLinguistic(const StrA: string; const IndexA: Integer; const StrB: string; const IndexB, Length: Integer): Integer; overload; static;
2class function CompareLinguistic(const StrA: string; const IndexA: Integer; const StrB: string; const IndexB, Length: Integer; const IgnoreCase: Boolean): Integer; overload; static;
3class function CompareLinguistic(const StrA: string; const IndexA: Integer; const StrB: string; const IndexB, Length: Integer; const IgnoreCase: Boolean; const LocaleID: TLocaleID): Integer; overload; static;
4class function CompareLinguistic(const StrA: string; const IndexA: Integer; const StrB: string; const IndexB, Length: Integer; const Options: TCompareOptions): Integer; overload; static;
5class function CompareLinguistic(const StrA: string; const IndexA: Integer; const StrB: string; const IndexB, Length: Integer; const Options: TCompareOptions; const LocaleID: TLocaleID): Integer; overload; static;
6class function CompareLinguistic(const StrA: string; const IndexA: Integer; const StrB: string; const IndexB, Length: Integer; const LocaleID: TLocaleID): Integer; overload; static;
7class function CompareLinguistic(const StrA, StrB: string): Integer; overload; static;Compares StrA with StrB in the sort order of the default locale or of LocaleID, with the options or IgnoreCase given.
8class function CompareLinguistic(const StrA, StrB: string; const IgnoreCase: Boolean): Integer; overload; static;
9class function CompareLinguistic(const StrA, StrB: string; const IgnoreCase: Boolean; const LocaleID: TLocaleID): Integer; overload; static;
10class function CompareLinguistic(const StrA, StrB: string; const Options: TCompareOptions): Integer; overload; static;
11class function CompareLinguistic(const StrA, StrB: string; const Options: TCompareOptions; const LocaleID: TLocaleID): Integer; overload; static;
12class function CompareLinguistic(const StrA, StrB: string; const LocaleID: TLocaleID): Integer; overload; static;

Overload 1: class function CompareLinguistic(const StrA: string; const IndexA: Integer; const StrB: string; const IndexB, Length: Integer): Integer; overload; static;

#NameTypeDescription
1StrAstring
2IndexAInteger
3StrBstring
4IndexBInteger
5LengthInteger

Returns: Integer

Overload 2: class function CompareLinguistic(const StrA: string; const IndexA: Integer; const StrB: string; const IndexB, Length: Integer; const IgnoreCase: Boolean): Integer; overload; static;

#NameTypeDescription
1StrAstring
2IndexAInteger
3StrBstring
4IndexBInteger
5LengthInteger
6IgnoreCaseBoolean

Returns: Integer

Overload 3: class function CompareLinguistic(const StrA: string; const IndexA: Integer; const StrB: string; const IndexB, Length: Integer; const IgnoreCase: Boolean; const LocaleID: TLocaleID): Integer; overload; static;

#NameTypeDescription
1StrAstring
2IndexAInteger
3StrBstring
4IndexBInteger
5LengthInteger
6IgnoreCaseBoolean
7LocaleIDTLocaleID

Returns: Integer

Overload 4: class function CompareLinguistic(const StrA: string; const IndexA: Integer; const StrB: string; const IndexB, Length: Integer; const Options: TCompareOptions): Integer; overload; static;

#NameTypeDescription
1StrAstring
2IndexAInteger
3StrBstring
4IndexBInteger
5LengthInteger
6OptionsTCompareOptions

Returns: Integer

Overload 5: class function CompareLinguistic(const StrA: string; const IndexA: Integer; const StrB: string; const IndexB, Length: Integer; const Options: TCompareOptions; const LocaleID: TLocaleID): Integer; overload; static;

#NameTypeDescription
1StrAstring
2IndexAInteger
3StrBstring
4IndexBInteger
5LengthInteger
6OptionsTCompareOptions
7LocaleIDTLocaleID

Returns: Integer

Overload 6: class function CompareLinguistic(const StrA: string; const IndexA: Integer; const StrB: string; const IndexB, Length: Integer; const LocaleID: TLocaleID): Integer; overload; static;

#NameTypeDescription
1StrAstring
2IndexAInteger
3StrBstring
4IndexBInteger
5LengthInteger
6LocaleIDTLocaleID

Returns: Integer

Overload 7: class function CompareLinguistic(const StrA, StrB: string): Integer; overload; static;

Compares StrA with StrB in the sort order of the default locale or of LocaleID, with the options or IgnoreCase given.

#NameTypeDescription
1StrAstring
2StrBstring

Returns: Integer - -1, 0 or 1; an empty text sorts first.

Remarks:

The window forms compare Length characters from IndexA and IndexB (0-based); a window outside its text raises ESubstringRangeError. A failed comparison raises EOSError. Every text kind, both texts of one kind. Note: This routine is 19 to 153 times slower than Compare, and 11 to 65 times slower than CompareAscii with IgnoreCase, due to handling of the locale specific char handling. Use Compare or CompareAscii, if this handling is not needed.

Examples

Ignoring case, and the order of two texts.

uses Substr;

procedure Example;
begin
    Assert(Substring.CompareLinguistic('abc', 'ABC', True) = 0);
    Assert(Substring.CompareLinguistic('a', 'b') = -1);
end;

Overload 8: class function CompareLinguistic(const StrA, StrB: string; const IgnoreCase: Boolean): Integer; overload; static;

#NameTypeDescription
1StrAstring
2StrBstring
3IgnoreCaseBoolean

Returns: Integer

Overload 9: class function CompareLinguistic(const StrA, StrB: string; const IgnoreCase: Boolean; const LocaleID: TLocaleID): Integer; overload; static;

#NameTypeDescription
1StrAstring
2StrBstring
3IgnoreCaseBoolean
4LocaleIDTLocaleID

Returns: Integer

Overload 10: class function CompareLinguistic(const StrA, StrB: string; const Options: TCompareOptions): Integer; overload; static;

#NameTypeDescription
1StrAstring
2StrBstring
3OptionsTCompareOptions

Returns: Integer

Overload 11: class function CompareLinguistic(const StrA, StrB: string; const Options: TCompareOptions; const LocaleID: TLocaleID): Integer; overload; static;

#NameTypeDescription
1StrAstring
2StrBstring
3OptionsTCompareOptions
4LocaleIDTLocaleID

Returns: Integer

Overload 12: class function CompareLinguistic(const StrA, StrB: string; const LocaleID: TLocaleID): Integer; overload; static;

#NameTypeDescription
1StrAstring
2StrBstring
3LocaleIDTLocaleID

Returns: Integer