String to decode entities and remove tags from.
A modified string, with unwanted bits stripped out and/or decoded.
immutable t1 = ""Hello world!""; immutable t1p = decodeEntities(t1); assert((t1p == "\"Hello\u00A0world!\""), t1p); // not a normal space immutable t2 = "</title>"; immutable t2p = decodeEntities(t2); assert((t2p == "</title>"), t2p); immutable t3 = "—µ´¥€"; immutable t3p = decodeEntities(t3); assert((t3p == "—µ´¥€"), t3p); // not a normal dash immutable t4 = ""Señor Þ" ©2017"; immutable t4p = decodeEntities(t4); assert((t4p == `"Señor Þ" ©2017`), t4p); immutable t5 = "\n Nyheter - NSD.se \n"; immutable t5p = decodeEntities(t5); assert(t5p == "Nyheter - NSD.se");
Removes unwanted characters from a string, and decodes HTML entities in it (like — and ).