Delphi and the three strings
Once upon a time, in the early days of pascal, there where short strings. They consisted of a block of bytes with a max size of 256. The first byte was the length byte:
5, H, e, l, l, o
You could define fixed length strings to save memory:
a: string[5];
Windows uses C strings, which are a pointer to a memory block terminated with a 0 character. These strings where not limited to 255 bytes. First they where provided as the PChar (pointer to char). But later the default string was interpreted as a C type string. You still could use shortstrings:
a: string[22];
b: ShortString;
c: string; // C (Delphi) string
With Delphi 2009, Unicode was introduced. Now each string was a Unicode string. Which is a pointer to a piece of memory containing unicode characters.
We still have the ShortString type. The old ansi strings could be accessed by AnsiString or PAnsiChar.
Now that strings are pointers, there is no limit to the size. But string literals are still limited to 255 characters.