Difference between revisions of "TStringList.Clear"

From Soldat Community Wiki
Jump to: navigation, search
(new page)
 
(No difference)

Latest revision as of 16:56, 23 August 2013

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.