System.AnsiStrings.CompareText

From RAD Studio API Documentation
Jump to: navigation, search

Delphi

function CompareText(const S1, S2: AnsiString): Integer;
function CompareText(const S1, S2: AnsiString; LocaleOptions: TLocaleOptions): Integer;

C++

extern DELPHI_PACKAGE int __fastcall CompareText(const System::AnsiString S1, const System::AnsiString S2)/* overload */;

Properties

Type Visibility Source Unit Parent
function public
System.AnsiStrings.pas
System.AnsiStrings.hpp
System.AnsiStrings System.AnsiStrings

Description

Compare two strings for equality without case-sensitivity.

CompareText compares S1 to S2 without case-sensitivity. The return value is less than 0 if S1 < S2, 0 if S1 = S2, or greater than 0 if S1 > S2. The compare operation is based on the 8-bit ordinal value of each character, after converting 'a'..'z' to 'A'..'Z', and is not affected by the current user locale.

Use CompareStr to compare strings with case-sensitivity.

Use AnsiCompareText to compare strings for the current user locale.

See Also

Code Examples