System.SysUtils.TStringHelper.Substring
Delphi
function Substring(StartIndex: Integer): string; overload;
function Substring(StartIndex: Integer; Length: Integer): string; overload;
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 0-based 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