stripTags

Removes <tags> from a string.

@safe
stripTags
(
T
)
(
const T line
)

Parameters

line T

A line of text, presumably with <tags> to remove.

Return Value

Type: auto

The passed line with any <tags> removed. The original string is passed back if there was nothing to remove.

Examples

enum pattern = "
    <l>Your private authorisation key is: <i>%s</>
    It should be entered as <i>pass</> under <i>[IRCBot]</>
    ";
immutable newMessage = newPattern
    .format(pass)
    .stripTags();

enum patternWithColouredNickname = "No quotes for nickname <h>%s<h>.";
immutable uncolouredMessage = patternWithColouredNickname
    .format(event.sender.nickname)
    .stripTags();
{
    immutable line = "This is a <l>log</> line.";
    immutable replaced = line.stripTags();
    immutable expected = "This is a log line.";
    assert((replaced == expected), replaced);
}