System.SysUtils.CompareText
Delphi
function CompareText(const S1, S2: string): Integer;
function CompareText(const S1, S2: string; LocaleOptions: TLocaleOptions): Integer;
C++
extern DELPHI_PACKAGE int __fastcall CompareText(const System::UnicodeString S1, const System::UnicodeString S2)/* overload */;
Properties
Type | Visibility | Source | Unit | Parent |
---|---|---|---|---|
function | public | System.SysUtils.pas System.SysUtils.hpp |
System.SysUtils | System.SysUtils |
Description
Compares two strings by their ordinal value, without case sensitivity.
CompareText compares S1
and S2
and returns 0 if they are equal. If S1
is greater than S2
, CompareText returns an integer greater than 0. If S1
is less than S2
, CompareText returns an integer less than 0. CompareText is not case sensitive and is not affected by the current locale, when using the first CompareText overloaded method.
The LocaleOptions
parameter of the second CompareText overloaded method is of type TLocaleOptions and defines a choice of dependent and independent locale options. For more information, please refer to the TLocaleOptions topic.
See Also