System.WideStrings.TWideStringList.CompareStrings

From RAD Studio API Documentation
Jump to: navigation, search

Delphi

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

C++

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

Properties

Type Visibility Source Unit Parent
function protected
System.WideStrings.pas
System.WideStrings.hpp
System.WideStrings TWideStringList

Description

Compares two strings.

System.WideStrings.TWideStringList.CompareStrings inherits from System.WideStrings.TWideStrings.CompareStrings. All content below this line refers to System.WideStrings.TWideStrings.CompareStrings.

Compares two strings.

TWideStrings uses CompareStrings internally to compare the values of strings that appear in the list. For example, the IndexOf and IndexOfName methods use CompareStrings to compare a specified string with the strings 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 TWideStrings, CompareStrings uses the global WideCompareText function, which compares strings case insensitively. Some descendant classes override this method to change the way strings are compared (for example, to introduce case sensitivity).

See Also