ircItalics

Returns the passed something wrapped in between IRC italics control characters.

@safe
ircItalics
(
T
)

Parameters

something T

Something std.conv.to-convertible to enwrap in italics.

Return Value

Type: auto

The passed something, as a string, in IRC italics.

Examples

import std.conv : to;
alias I = IRCControlCharacter;

{
    immutable line = "kameloso: " ~ ircItalics("kameloso");
    immutable expected = "kameloso: " ~ I.italics ~ "kameloso" ~ I.italics;
    assert((line == expected), line);
}
{
    immutable number = 1234;
    immutable line = number.ircItalics;
    immutable expected = I.italics ~ number.to!string ~ I.italics;
    assert((line == expected), line);
}
{
    immutable b = true;
    immutable line = b.ircItalics;
    immutable expected = I.italics ~ "true" ~ I.italics;
    assert((line == expected), line);
}

Meta