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 qui commence à la position de StartIndex et qui facultativement se termine à la position StartIndex + Length, si spécifiée, à partir de cette chaîne basée en 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