Overload List
| # | Signature | Description |
|---|---|---|
| 1 | class function CompareAscii(const StrA: string; const IndexA: Integer; const StrB: string; const IndexB, Length: Integer; const IgnoreCase: Boolean): Integer; overload; static; | |
| 2 | class function CompareAscii(const StrA, StrB: string; const IgnoreCase: Boolean): Integer; overload; static; | Compares StrA with StrB, or Length characters of each from IndexA and IndexB (0-based), by UTF-16 code unit; IgnoreCase True folds 'a'..'z' to upper case. |
Overload 1: class function CompareAscii(const StrA: string; const IndexA: Integer; const StrB: string; const IndexB, Length: Integer; const IgnoreCase: Boolean): Integer; overload; static;
| # | Name | Type | Description |
|---|---|---|---|
| 1 | StrA | string | |
| 2 | IndexA | Integer | |
| 3 | StrB | string | |
| 4 | IndexB | Integer | |
| 5 | Length | Integer | |
| 6 | IgnoreCase | Boolean |
Returns: Integer
Overload 2: class function CompareAscii(const StrA, StrB: string; const IgnoreCase: Boolean): Integer; overload; static;
Compares StrA with StrB, or Length characters of each from IndexA and IndexB (0-based), by UTF-16 code unit; IgnoreCase True folds 'a'..'z' to upper case.
| # | Name | Type | Description |
|---|---|---|---|
| 1 | StrA | string | |
| 2 | StrB | string | |
| 3 | IgnoreCase | Boolean |
Returns: Integer - 0 when equal, else the difference of the first differing pair, or of the lengths when one text is a prefix of the other.
Remarks:
Every text kind, both texts of one kind. A window outside its text raises ESubstringRangeError. Note: This routine handles only ANSI/ASCII case char mapping and does not handle locale specific char handling, but it is 11 to 65 times faster than its CompareLinguistic alternative.
Examples
Case ignored.
uses Substr;
procedure Example;
begin
Assert(Substring.CompareAscii('abc', 'ABC', True) = 0);
Assert(Substring.CompareAscii('xABC', 1, 'abc', 0, 3, True) = 0);
end;
See Also: Substring.CompareInvariant, Substring.CompareInvariant, Substring.CompareLinguistic, Substring.CompareLinguistic, Substring.CompareLinguistic, Substring.CompareLinguistic, Substring.CompareLinguistic, Substring.CompareLinguistic, Substring.CompareLinguistic, Substring.CompareLinguistic, Substring.CompareLinguistic, Substring.CompareLinguistic, Substring.CompareLinguistic, Substring.CompareLinguistic