[fpc-pascal] String conversions

Jonas Maebe jonas at freepascal.org
Tue Jun 25 21:18:07 CEST 2019


On 25/06/2019 21:12, Ryan Joseph wrote:
> 
> Another question: if I do "s += c” will the string reallocate memory for 1 character or is there an exponential growing function? If it does grow by one character at a time how can I reserve a certain capacity in advance?

Strings always contain the exact amount of memory required for their length.

If you need to do a lot of concatenations, you can use the
TStringBuilder class from sysutils for better performance.


Jonas


More information about the fpc-pascal mailing list