procedure UniqueString(var Str: Substring); overload; inline;
Gives Str its own copy of its characters, shared with no other string.
| # | Name | Type | Description |
|---|---|---|---|
| 1 | Str | Substring |
Result: stored in self (calling object)
Examples
An adopted string made the string's own.
uses Substr;
procedure Example;
var Text: string;
s: Substring;
begin
Text := 'abc';
s.Adopt(Text);
UniqueString(s);
Assert(not s.IsExternal);
end;