System.SysUtils.TStringHelper.Substring

De RAD Studio API Documentation
Aller à : navigation, rechercher

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 commençant à la position StartIndex et se terminant facultativement à la position StartIndex + Length, si elle est spécifiée, à partir de cette chaîne de base zéro.

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

Sortie :

 is a string.
 is

Voir aussi