IComparerClass.StringComparer

Syntax

StringComparer: IComparer;

Description

The StringComparer property returns object to compare elements of string type. Comparison is executed taking into account the length and case of element contents.

Example

Sub Main;

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 Main;

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

See also:

IComparerClass