Substring.CompareTo Method

Overload List

#SignatureDescription
1function CompareTo(const strB: Substr.Substring): Integer; overload;Compares the text with strB, ordinal.
2function CompareTo(const strB: string): Integer; overload;

Overload 1: function CompareTo(const strB: Substr.Substring): Integer; overload;

Compares the text with strB, ordinal.

#NameTypeDescription
1strBSubstr.Substring

Returns: Integer - Compare's value: 0 when equal, else the difference of the first differing characters, or of the lengths when one text is a prefix of the other.

Examples

Ordering two texts.

uses Substr;

procedure Example;
begin
    Assert(Substring('b').CompareTo('a') = 1);
end;

Overload 2: function CompareTo(const strB: string): Integer; overload;

#NameTypeDescription
1strBstring

Returns: Integer