System.AnsiStrings.CompareStr

From RAD Studio API Documentation
Jump to: navigation, search

Delphi

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

C++

extern DELPHI_PACKAGE int __fastcall CompareStr(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 with case-sensitivity.

CompareStr compares the strings S1 to S2, with 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 and is not affected by the current user locale.

Use CompareText to compare strings without case-sensitivity.

Use AnsiCompareStr to compare strings for the current user locale.

See Also

Code Examples