A line of text, presumably with <tags> to remove.
The passed line with any <tags> removed. The original string is passed back if there was nothing to remove.
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); }
Removes <tags> from a string.