Substring.IsDelimiter Method

function IsDelimiter(const Delimiters: string; const Index: Integer): Boolean; overload;

Whether the character at Index (0-based) is one of Delimiters.

#NameTypeDescription
1Delimitersstring
2IndexIntegerstart index

Returns: Boolean

Remarks:

A surrogate code unit is never a delimiter, and #0 is one only when Delimiters holds it. An Index outside the text raises ESubstringRangeError. Delimiters takes every text kind.

Examples

A comma among the delimiters.

uses Substr;

procedure Example;
var s: Substring;
begin
    s := Substring('a,b');
    Assert(s.IsDelimiter(',;', 1));
    Assert(not s.IsDelimiter(',;', 0));
end;