Difference between revisions of "TStringList.Delete"

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

Latest revision as of 11:30, 24 August 2013

procedure Delete(Index: Integer)
 Index: index of the string that is to be removed

Description

Delete deletes the string at position Index from the list.
The associated object is also removed from the list, but not destroyed.
Index is zero-based, and should be in the range 0 to Count-1.

Example

var
  s: TStringList;

begin
  s := File.CreateStringList();
  s.Append('a');
  s.Append('b');
  s.Append('c');
  
  s.Delete(1);
  
  WriteLn(s.CommaText);
  // a,c
  
  s.Free;
end.