The
String data type holds sequences of characters, such as sentences.
The string is treated as an
AnsiString by default. However, it can be treated as a
ShortString if the
$LongStrings compiler directive is set
Off (the default is
On).
An
AnsiChar can hold any number of characters, restricted only by memory.
Version 2, however, forces the string to be a
ShortString by defining a
FixedSize (up to 255 characters). This is particularly important when creating many strings and especially so when storing strings in records (as in example 2).
Strings can be assigned from other strings, from functions that return a string, and with concatenations as in the sample code.
(Information taken from
delphibasics.co.uk« and has been edited)