[fpc-pascal] Any chance to add the TStringBuilder to FCL?
Sven Barth
pascaldragon at googlemail.com
Thu Apr 14 20:27:59 CEST 2016
On 14.04.2016 19:36, leledumbo wrote:
>> Is there any chance to add a class like Delphi's TStringBuilder to FCL? It
> would be very useful to port Delphi code libraries to Free Pascal.
>
> That exists mainly to overcome the read-only, 0-based string implementation
> limitations in Delphi NextGen, doesn't it? Porting will still require
> 0-based string implementation, that class implementation alone won't be
> enough.
We already have zero based strings in 3.0.0 if {$ZeroBasedStrings On} is
used (it's a local switch). It works with Ansi-, Wide- and
UnicodeString, but not with ShortString.
The following example will print
=== output begin ===
l
o
=== output end ===
=== code begin ===
program tzerostr;
{$H+}
var
s: String;
begin
s := 'Hello World';
Writeln(s[4]);
{$ZeroBasedStrings On}
Writeln(s[4]);
end.
=== code end ===
Regards,
Sven
More information about the fpc-pascal
mailing list