// String concatenation
var s = "Hello";
s ~= " World";
assert(s.as!string == "Hello World");
// Array append
var arr = var([1, 2]);
arr ~= 3;
assert(arr.length == 3);var.opOpAssign
void opOpAssign(string op, T)(T rhs) if (op == "~") @safeOperator `~=` for append or string concatenation.
For Type.STRING, concatenates the string representation of rhs to the current string value. For all other types (including NULL), appends rhs as a new element to an array (converting to array if necessary).
Parameters
rhs | The value to append or concatenate. |