System.SysUtils.TStringHelper.Substring

From RAD Studio API Documentation
Jump to: navigation, search

Delphi

function Substring(StartIndex: Integer): string; overload; inline;
function Substring(StartIndex: Integer; Length: Integer): string; overload; inline;

Properties

Type Visibility Source Unit Parent
function public System.SysUtils.pas System.SysUtils TStringHelper

Description

Returns the substring starting at the position StartIndex and optionally ending at the position StartIndex + Length, if specified, from this string.

var
  MyString: String;

begin
  MyString := 'This is a string.';

  Writeln(MyString.Substring(5));
  Writeln(MyString.Substring(5, 2));
end.

Output:

is a string.
is

See Also