System.SysUtils.TStringHelper.Substring

提供: RAD Studio API Documentation
移動先: 案内検索

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

説明

0 基準の文字列から、位置 StartIndex から始まるサブ文字列を返します。任意で、終わりの位置 StartIndex + Length を指定することも可能です。

 var
   MyString: String;
 
 begin
   MyString := 'This is a string.';
 
   Writeln(MyString.Substring(5));
   Writeln(MyString.Substring(5, 2));
 end.

出力は以下のとおりです。

 is a string.
 is

関連項目