Function BasicString.opBinary

Returns a newly constructed BasicString object with its value being the concatenation of the characters in this followed by those of rhs.

typeof(this) opBinary(string op) (
  scope const BasicString.CharType[] rhs
) scope
if (op == "+" || op == "~");

typeof(this) opBinary(string op, Rhs) (
  auto scope const ref Rhs rhs
) scope
if ((op == "+" || op == "~") && (isBasicString!Rhs || isSomeChar!Rhs || isSomeString!Rhs || isCharArray!Rhs || isIntegral!Rhs));

Parameter rhs can by type of BasicString!(...), char|wchar|dchar array/slice/character.

Examples

BasicString!char str = null;
assert(str.empty);

str = str + '1';
assert(str == "1");

str = str + "23"d;
assert(str == "123");

str = str + BasicString!dchar("456");
assert(str == "123456");