TStringList.Clear

From Soldat Community Wiki
Revision as of 17:56, 23 August 2013 by Mighty (talk | contribs) (new page)
(diff) ← Older revision | Latest revision (diff) | Newer revision → (diff)
Jump to: navigation, search
procedure Clear()

Description

Clear will remove all strings and their associated objects from the list. After a call to clear, Count is zero.

Example

var
  s: TStringList;

begin
  s := File.CreateStringList();

  s.Append('a');
  s.Append('b');
  s.Append('d');
  WriteLn('|'+s.CommaText+'|');
  // |a,b,d|

  s.Clear;
  WriteLn('|'+s.CommaText+'|');
  // ||

  s.Free;
end.