System.SysUtils.TStringHelper.Substring
Delphi
function Substring(StartIndex: Integer): string; overload; inline;
function Substring(StartIndex: Integer; Length: Integer): string; overload; inline;
Propriétés
Type | Visibilité | Source | Unité | Parent |
---|---|---|---|---|
function | public | System.SysUtils.pas | System.SysUtils | TStringHelper |
Description
Renvoie la sous-chaîne qui commence à la position StartIndex
et qui se termine éventuellement à la position StartIndex
+ Length
, si elle est spécifiée, à partir de cette chaîne.
var
MyString: String;
begin
MyString := 'This is a string.';
Writeln(MyString.Substring(5));
Writeln(MyString.Substring(5, 2));
end.
Sortie :
is a string. is