IComparerClass.StringComparer

Syntax

StringComparer: IComparer;

Description

The StringComparer property returns an object for comparing elements of string type.

Comments

Comparison is executed taking into account the length and case of element contents.

Example

Sub UserProc;
Var
    Com: IComparer;
    i, i1, i2, i3: Integer;
Begin
    Com := Comparer.StringComparer;
    i := Com.Compare("a""A");
    i1 := Com.Compare("aa""A");
    i2 := Com.Compare("a""AA");
    i3 := Com.Compare("aA""Aa");
End Sub UserProc;

After executing the example the "i, i1, i2, i3" variables contain the "-1, 1, -1, -1" values respectively.

See also:

IComparerClass