Copy a string: Difference between revisions

Content added Content deleted
m (→‎{{header|Wren}}: Changed to Wren S/H)
Line 2,637: Line 2,637:


Although technically a reference type, this means there is no need to distinguish between copying the contents of a string and making an additional reference. We can therefore just use assignment to copy a string.
Although technically a reference type, this means there is no need to distinguish between copying the contents of a string and making an additional reference. We can therefore just use assignment to copy a string.
<syntaxhighlight lang="ecmascript">var s = "wren"
<syntaxhighlight lang="wren">var s = "wren"
var t = s
var t = s
System.print("Are 's' and 't' equal? %(s == t)")</syntaxhighlight>
System.print("Are 's' and 't' equal? %(s == t)")</syntaxhighlight>