stripModesign

Convenience function to stripModesign that doesn't take an out string parameter to store the stripped modesign characters in.

  1. auto stripModesign(string nickname, IRCServer server, string modesigns)
  2. auto stripModesign(string nickname, IRCServer server)
    pure @safe nothrow @nogc
    stripModesign
    (
    const string nickname
    ,)

Parameters

nickname string

The (potentially) signed nickname to strip the prefix off.

server IRCServer

The IRCServer whose prefix characters to strip.

Return Value

Type: auto

The raw nickname, unsigned.

Examples

IRCServer server;
immutable signed = "@+kameloso";
immutable nickname = signed.stripModeSign(server);
assert((nickname == "kameloso"), nickname);
assert((signs == "@+"), signs);
IRCServer server;
server.prefixchars =
[
    '@' : 'o',
    '+' : 'v',
    '%' : 'h',
];

{
    immutable signed = "@+kameloso";
    immutable nickname = signed.stripModesign(server);
    assert((nickname == "kameloso"), nickname);
}