Copy a string: Difference between revisions

m
Line 1,575:
<code>String.copy</code> issues a deprecation warning, and a (shallow) copy would simply be an assignment by default:
<lang ocaml>let dst = src</lang>
To get a mutable deep-copy still, just convert the string to bytes via <code>Bytes.of_string</code>, which copies for safety, or <code>String.sub/map/init/blit/..</code> for an immutable copy.
<br/>
<br/>
13

edits