Re: copy one character from a string.
- From: "Bjørge" <bjorge@xxxxxxxxxxxxxxx>
- Date: Wed, 23 Nov 2005 13:32:57 +0100
MLian wrote:
> That did the trick.
> I'd forgot the Setlength statement.
Do also notice that the string type has a copy-on-change functionality:
var
S1,
S2: string;
begin
S1:='Some incredibly long string, maybe MB''s of length';
S2:=S1; // S2 now points to S1, only one instance exists in memory. The
string has a refcount of 2.
S2[1]:='X'; // S2 is now copied into a newly allocated string, both S1 and
S2 having a refcount of 1.
--
Bjørge
bjorge@xxxxxxxxxxxx
.
- Follow-Ups:
- Re: copy one character from a string.
- From: alanglloyd@xxxxxxx
- Re: copy one character from a string.
- References:
- copy one character from a string.
- From: MLian
- Re: copy one character from a string.
- From: Dodgy
- Re: copy one character from a string.
- From: MLian
- copy one character from a string.
- Prev by Date: Re: pointer syntax
- Next by Date: Using Delphi for mobile apps??
- Previous by thread: Re: copy one character from a string.
- Next by thread: Re: copy one character from a string.
- Index(es):
Relevant Pages
|