Sign in Join
Wiki copytemporary

TStrings: what changed

Revision 0 to 1. Removed lines have a minus sign; added lines have a plus sign.

Title: TStrings

OldNewLine
1+A **TStrings** is a datatype that can hold an arbitrary length list of [[String|strings]]. The strings in a TStrings are accessible as concatenated plain text or as a series of strings.
2+
3+Inheritance
4+
5+- [[TObject]] - Base class of all classes.
6+ - [[TPersistent]] - Base class for streaming system and persistent properties - [[IFPObserved]] interface implemented by an object that can be observed.
7+ - [[TStrings]] - Class to manage arrays or collections of strings
8+
9+Basic functionality:
10+
11+Methods
12+Add() - add a string to the list
13+
14+AddStrings() - Add contents of another stringlist to this list.
15+
16+Assign() - Assign the contents of another stringlist to this one.
17+
18+Clear() - Removes all strings and associated objects from the list.
19+
20+IndexOf() - Find a string in the list and return its position.
21+
22+IndexOfName()- Finds the index of a name in the name-value pairs.
23+
24+Insert() - Insert a string in the list.
25+
26+LoadFromFile() - Load the contents of a file as a series of strings.
27+
28+LoadFromStream() - Load the contents of a stream as a series of strings.
29+
30+SaveToFile() - Save the contents of the list to a file.
31+
32+SaveToStream() - Save the contents of the string to a stream.
33+
34+GetNameValue() - Return both name and value of a name,value pair based on it's index.
35+
36+ExtractName() - Extract the name part of a string
37+
38+properties
39+TextLineBreakStyle - Determines which line breaks to use in the Text property
40+
41+Delimiter - Delimiter character used in DelimitedText.
42+
43+DelimitedText - Get or set all strings in the list in a delimited form.
44+
45+StrictDelimiter - Should only the delimiter character be considered a delimiter
46+
47+QuoteChar - Quote character used in DelimitedText.
48+
49+NameValueSeparator - Value of the character used to separate name,value pairs
50+
51+ValueFromIndex - Return the value part of a string based on it's index.
52+
53+Capacity - Capacity of the list, i.e. number of strings that the list can currently hold before it tries to expand.
54+
55+CommaText - Contents of the list as a comma-separated string.
56+
57+Count - Number of strings in the list.
58+
59+Names - Name parts of the name-value pairs in the list.
60+
61+Objects - Indexed access to the objects associated with the strings in the list.
62+
63+Values - Value parts of the name-value pairs in the list.
64+
65+Strings - Indexed access to the strings in the list.
66+
67+Text - Contents of the list as one big string.
68+
69+## See also
70+
71+- [[doc:rtl/classes/tstrings.html|TStrings doc]]
72+- [[TStringList]]
73+- [[TStringList-TStrings Tutorial]]
74+
75+---
76+*From the Free Pascal wiki, page "TStrings", as it stood on 2017-02-23 after a change by Arent, out of the wiki's dump of 2024-05-26. Copyright stays with the author who wrote it, according to the old wiki's [[Licensing]] page. If you have concerns about this material, [message the admin](/wiki-contact).*
77+Category: Containers
78+Category: RTL

Back to history