System.SysUtils.TStringHelper.PadRight

De RAD Studio API Documentation
Aller à : navigation, rechercher

Delphi

function PadRight(TotalWidth: Integer): string; overload; inline;
function PadRight(TotalWidth: Integer; PaddingChar: Char): string; overload; inline;

Propriétés

Type Visibilité  Source Unité  Parent
function public System.SysUtils.pas System.SysUtils TStringHelper


Description

Aligne à gauche une chaîne selon un espacement de texte de longueur fixe.

var
  MyString1: String;
  MyString2: String;

begin
  MyString1 := '12345';
  MyString2 := '123';
  Writeln(MyString1.PadRight(5));
  Writeln(MyString2.PadRight(5));
end.

Sortie :


12345
123

Deux méthodes PadRight surchargées existent. La première suppose que le caractère de remplissage est l'espace vide, alors que la seconde vous laisse spécifier le caractère de remplissage.

Voir aussi