System.Classes.TStrings.Strings

From Appmethod Libraries
Jump to: navigation, search

Object Pascal

property Strings[Index: Integer]: string read Get write Put; default;

C++

__property System::UnicodeString Strings[int Index] = {read=Get, write=Put/*, default*/};

Properties

Type Visibility Source Unit Parent
property public
System.Classes.pas
System.Classes.hpp
System.Classes TStrings

Description

References the strings in the list by their positions.

Descendants of TStrings must implement an accessor function for the Strings property to return the string at the position indicated by Index. Index gives the position of the string, where 0 is the first string, 1 is the second string, and so on.

Use the Strings property to get or set the string at a particular position.

To store a string as a name-value pair, assign Strings a value that includes the NameValueSeparator character. The name and value will then be accessible separately using the Names and Values properties.

Note: In Object Pascal, Strings is the default property of TStrings objects. The Strings identifier can be omitted when accessing the Strings property of a descendant of TStrings. For example, the following two lines of code are both acceptable and do the same thing:

MyStrings.Strings[0] := 'This is the first string';
MyStrings[0] := 'This is the first string';

See Also

Code Examples