From RAD Studio API Documentation
Jump to: navigation, search


function AnsiCompareStr(const S1, S2: string): Integer;


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


Type Visibility Source Unit Parent
function public
System.SysUtils System.SysUtils


Compares strings based on the current locale with case sensitivity.

AnsiCompareStr compares S1 to S2, with case sensitivity. The comparison operation is controlled by the current locale. The return value is one of the following.

Condition Return Value

S1 > S2

> 0

S1 < S2

< 0

S1 = S2

= 0

Note: Most locales consider lowercase characters to be less than the corresponding uppercase characters. This is in contrast to ASCII order, in which lowercase characters are greater than uppercase characters. Thus, setting S1 to 'a' and S2 to 'A' causees AnsiCompareStr to return a value less than zero, while CompareStr, with the same arguments, returns a value greater than zero.

See Also