Text.opBinary

Concatenate the current string with another.

  1. Text opBinary(string text)
    class Text
    final ref pure nothrow
    opBinary
    (
    string op
    )
    (
    string text
    )
    if (
    op == "~" ||
    op == "+"
    )
  2. Text opBinary(Text t)

Examples

Font fnt = new Font("samples/font/arial.ttf", 12);
Text t = new Text(font);
t("My new string");
t ~= "is great!"; // t draws now 'My new string is great' on screen.

The example above is the same as if you do:

t += "is great!";

Both operators (~ and +) are allowed.

Meta