function IndexOfEither(const C1, C2: Char): Integer;
The 0-based index of the first character that is C1 or C2; -1 when there is none.
| # | Name | Type | Description |
|---|---|---|---|
| 1 | C1 | Char | |
| 2 | C2 | Char |
Returns: Integer
Examples
The end of the first line, whichever line break it has.
uses Substr;
procedure Example;
var s: Substring;
begin
s := Substring('first'#13#10'second');
Assert(s.IndexOfEither(#13, #10) = 5);
s := Substring('first'#10'second');
Assert(s.IndexOfEither(#13, #10) = 5);
end;
See Also: Substring.IndexOfAny, Substring.IndexOfAny