System.Classes.TStringList.CompareStrings

From RAD Studio API Documentation
Jump to: navigation, search

Delphi

function CompareStrings(const S1, S2: string): Integer; override;

C++

virtual int __fastcall CompareStrings(const System::UnicodeString S1, const System::UnicodeString S2);

Properties

Type Visibility Source Unit Parent
function protected
System.Classes.pas
System.Classes.hpp
System.Classes TStringList

Description

Compares two strings.

The CompareStrings method is used to compare the values of strings that appear in the list.

S1 and S2 are the strings to compare.

CompareStrings returns a value less than 0 if S1 < S2, 0 if S1 = S2, and a value greater than 0 if S1 > S2.

As implemented in TStringList, CompareStrings uses the global AnsiCompareText function, which compares strings case-insensitively if the CaseSensitive property is set to False. Otherwise, the case-sensitive AnsiCompareStr method is used.

See Also