Clone
Returns an independent copy of the string.
Module: Std
Signature
rux
func Clone(self) -> String;Returns
String — a new string with its own buffer holding the same bytes.
Description
Clone allocates a new buffer and copies the receiver's contents into it, so the result can be modified or outlive the original without affecting it. Cloning an empty string returns another empty string.
This is the way to keep a segment produced by Split alive after the source string is gone, since those segments are views rather than owned copies.