Copy a string: Difference between revisions
Content deleted Content added
Modula-3 |
add E example |
||
Line 202:
// copy reference with copy-on-write:
auto dest2 = src;
=={{header|E}}==
E is a [[pass-references-by-value]] object-oriented language, and strings are immutable, so there is never a need for or benefit from copying a string. Various operations, such as taking the substring (run) from the beginning to the end (<code><var>someString</var>.run(0)</code>) might create a copy, but this is not guaranteed.
=={{header|Erlang}}==
|