System.Classes.TStringList.Insert

From RAD Studio API Documentation
Jump to: navigation, search

Delphi

procedure Insert(Index: Integer; const S: string); override;

C++

virtual void __fastcall Insert(int Index, const System::UnicodeString S);

Properties

Type Visibility Source Unit Parent
procedure
function
public
System.Classes.pas
System.Classes.hpp
System.Classes TStringList

Description

Inserts a string to the list at the position specified by Index.

Call Insert to add the string S to the list at the position specified by Index. If Index is 0, the string is inserted at the beginning of the list. If Index is 1, the string is put in the second position of the list, and so on.

If the string has an associated object, use the InsertObject method instead.

Note: If the list is sorted, calling Insert or InsertObject will raise an EListError exception. Use Add or AddObject with sorted lists.

See Also