String.opAssign - multiple declarations
Function String.opAssign
Assigns another string.
If that is passed by value, it won't be copied, but moved. This string will take the ownership over that's storage and the allocator.
If that is passed by reference, it will be copied.
Parameters
Name | Description |
---|---|
S | Content type. |
that | The value should be assigned. |
Returns
this.
Example
auto s = String("Черная, потом пропахшая выть!");
s = String("Как мне тебя не ласкать, не любить?");
Function String.opAssign
Assigns a stringish range.
ref String opAssign(S)
(
S that
)
if (!isInfinite!S && isInputRange!S && isSomeChar!(ElementType!S));
Parameters
Name | Description |
---|---|
S | String type. |
that | Initial string. |
Returns
this.
Throws
UTFException.
Example
auto s = String("Оловом светится лужная голь...");
s = "Грустная песня, ты - русская боль.";
assert(s == "Грустная песня, ты - русская боль.");