Substring.IndexOfAnyUnquoted Method

Overload List

#SignatureDescription
1function IndexOfAnyUnquoted(const AnyOf: array of Char; const StartQuote, EndQuote: Char; const StartIndex: Integer = 0): Integer; overload;The 0-based index of the first character that is one of AnyOf outside StartQuote ... EndQuote.
2function IndexOfAnyUnquoted(const AnyOf: array of Char; const StartQuote, EndQuote: Char; const StartIndex, Count: Integer): Integer; overload;

Overload 1: function IndexOfAnyUnquoted(const AnyOf: array of Char; const StartQuote, EndQuote: Char; const StartIndex: Integer = 0): Integer; overload;

The 0-based index of the first character that is one of AnyOf outside StartQuote ... EndQuote.

#NameTypeDescription
1AnyOfarray of Char
2StartQuoteChar
3EndQuoteChar
4StartIndexInteger

Returns: Integer - The index, or -1.

Remarks:

The search runs from StartIndex, which must lie outside quotes, to the end or for Count characters; a range outside the text raises ESubstringRangeError.

Examples

A comma inside quotes is skipped.

uses Substr;

procedure Example;
begin
    Assert(Substring('"a,b",c').IndexOfAnyUnquoted([','], '"', '"') = 5);
end;

Overload 2: function IndexOfAnyUnquoted(const AnyOf: array of Char; const StartQuote, EndQuote: Char; const StartIndex, Count: Integer): Integer; overload;

#NameTypeDescription
1AnyOfarray of Char
2StartQuoteChar
3EndQuoteChar
4StartIndexInteger
5CountInteger

Returns: Integer