Copy a string

From Rosetta Code
Revision as of 12:38, 19 February 2021 by Drkameleon (talk | contribs) (Replaced content with "=={{header|Arturo}}== <lang rebol>a: "Hello" b: a ; reference the same string ; changing one string in-place ; will change both strings 'b ++ "World" print b...")

Arturo

<lang rebol>a: "Hello" b: a  ; reference the same string

changing one string in-place
will change both strings

'b ++ "World" print b print a

c: "Hello" d: new c  ; make a copy of the older string

changing one string in-place
will change only the string in question

'd ++ "World" print d print c</lang>

Output:
HelloWorld
HelloWorld
HelloWorld
Hello