Copy a string: Difference between revisions
Added Wren
(Added Wren) |
|||
Line 2,168:
<lang vbnet>Dim a As String = "Test String"
Dim b As String = String.Copy(a) ' New string</lang>
=={{header|Wren}}==
A string in Wren is an ''immutable'' array of bytes.
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.
<lang ecmascript>var s = "wren"
var t = s
System.print("Are 's' and 't' equal? %(s == t)")</lang>
{{out}}
<pre>
Are 's' and 't' equal? true
</pre>
=={{header|X86 Assembly}}==
|