TStrings.Clear

TStrings = class (TObject)Interface de TStringsExemples de TStrings

Permet de supprimer toutes les chaînes contenues de la TStrings

Syntaxe

procedure Clear()

Remarques

  • Réinitialise une TStrings en supprimant son contenu.
  • Après l'appel de Clear, la propriété Count de la TStrings vaut 0.
  • Ses propriétés CommaText, SCSVText, TabText et Text valent '' (chaîne vide).

Exemples

var maListe := TStrings.Create;

maListe.Add('Chaîne1');
maListe.Add('Chaîne2');
InformationDlg(maListe.Text); // renvoie 'Chaîne1,Chaîne2'
maListe.Clear;
InformationDlg(maListe.Text); // renvoie ''

Classification

SysUtils TStrings