Substring.Mid Method

function Mid(const StartIndex, Count: Integer): Substring;

Count characters from StartIndex (0-based), both inside the text, else ESubstringRangeError is raised.

#NameTypeDescription
1StartIndexInteger
2CountInteger

Returns: Substring - The part. A part of a long text or of an adopted string shares its characters instead of copying them.

Examples

A part of a text.

uses Substr;

procedure Example;
begin
    Assert(Substring('abcdef').Mid(2, 3) = 'cde');
end;
See Also: Substring.Substring, Substring.Substring