The OpenD Programming Language

Grapheme.opOpAssign

Append $(CHARACTER) ch to this grapheme. Warning: Use of this facility may invalidate grapheme cluster, see also valid.

  1. ref opOpAssign(dchar ch)
    struct Grapheme
    ref @trusted
    opOpAssign
    (
    string op
    )
    (
    dchar ch
    )
  2. ref opOpAssign(Input inp)

Examples

import std.algorithm.comparison : equal;
auto g = Grapheme("A");
assert(g.valid);
g ~= '\u0301';
assert(g[].equal("A\u0301"));
assert(g.valid);
g ~= "B";
// not a valid grapheme cluster anymore
assert(!g.valid);
// still could be useful though
assert(g[].equal("A\u0301B"));

See Also

Meta