TStringList.Delete

From Soldat Community Wiki
Revision as of 12:30, 24 August 2013 by Mighty (talk | contribs) (new page)
(diff) ← Older revision | Latest revision (diff) | Newer revision → (diff)
Jump to: navigation, search
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.