[Overview][Constants][Types][Classes][Procedures and functions][Variables] Reference for unit 'Classes' (#rtl)

TStrings.Insert

Insert a string in the list.

Declaration

Source position: classesh.inc line 494

public procedure TStrings.Insert(

  Index: Integer;

  const S: String

); virtual; abstract;

Description

Insertinserts the string Sat position Indexin the list. Indexis a zero-based position, and can have values from 0to Count. If Indexequals Countthen the string is appended to the list.

Remark:
  1. All methods that add strings to the list use Insertto add a string to the list.
  2. If the string has an associated object, use TStrings.InsertObjectinstead.

Errors

If Indexis less than zero or larger than Countthen an EStringListErrorexception is raised.

See also

TStrings.Add

  

Add a string to the list

TStrings.InsertObject

  

Insert a string and associated object in the list.

TStrings.Append

  

Add a string to the list.

TStrings.Delete

  

Delete a string from the list.