System.SysUtils.TStringHelper.Substring
Delphi
function Substring(StartIndex: Integer): string; overload; inline;
function Substring(StartIndex: Integer; Length: Integer): string; overload; inline;
プロパティ
種類 | 可視性 | ソース | ユニット | 親 |
---|---|---|---|---|
function | public | System.SysUtils.pas | System.SysUtils | TStringHelper |
説明
位置 StartIndex
で始まり、任意指定の位置 StartIndex + Length
で終わる(指定されている場合)、サブ文字列を、この 0 ベース文字列から返します。
var
MyString: String;
begin
MyString := 'This is a string.';
Writeln(MyString.Substring(5));
Writeln(MyString.Substring(5, 2));
end.
出力:
is a string. is