A copy of s in newly allocated memory, with the context allocator. Free it with free. Use
copy_temporary_string for a copy that needs no freeing.
copy_string :: (s: string) -> string
Parameters
- s: string
Returns
- string
original := "text";
copy := copy_string(original);
defer free(copy);
assert(copy == original && copy.data != original.data);