withoutTypePrefix

Slices away any type prefixes from the string of a IRCEvent.Type.

Only for shared use in formatMessageMonochrome and formatMessageColoured.

version(WithPrinterPlugin)
package @safe @safe pure nothrow @nogc @property
withoutTypePrefix
(
const string typestring
)

Parameters

typestring string

The string form of a IRCEvent.Type.

Return Value

Type: auto

A slice of the passed typestring, excluding any prefixes if present.

Examples

immutable typestring1 = "PRIVMSG".withoutTypePrefix;
assert((typestring1 == "PRIVMSG"), typestring1);  // passed through

immutable typestring2 = "ERR_NOSUCHNICK".withoutTypePrefix;
assert((typestring2 == "NOSUCHNICK"), typestring2);

immutable typestring3 = "RPL_LIST".withoutTypePrefix;
assert((typestring3 == "LIST"), typestring3);
{
    immutable typestring = "RPL_ENDOFMOTD";
    immutable without = typestring.withoutTypePrefix;
    assert((without == "ENDOFMOTD"), without);
}
{
    immutable typestring = "ERR_CHANOPRIVSNEEDED";
    immutable without = typestring.withoutTypePrefix;
    assert((without == "CHANOPRIVSNEEDED"), without);
}
version(TwitchSupport)
{{
    immutable typestring = "TWITCH_USERSTATE";
    immutable without = typestring.withoutTypePrefix;
    assert((without == "USERSTATE"), without);
}}
{
    immutable typestring = "PRIVMSG";
    immutable without = typestring.withoutTypePrefix;
    assert((without == "PRIVMSG"), without);
}

Meta