Python solution without using replace
\nclass Solution:\n    def entityParser(self, text: str) -> str:\n    \n        d = {"&quot;": \'"\', "&apos;": "\'", "&amp;": "&", \n             "&gt;": ">", 
```\nclass Solution:\n    def entityParser(self, text: str) -> str:\n    \n        d = {"&quot;": \'"\', "&apos;": "\'", "&amp;": "&", \n             "&gt;": ">", "&lt;": "<", "&frasl;": "/"}\n\n        res = \'\'\n        n = len(text)\n        start = 0\n        while start < n:\n            c = text[start]\n            if c == \'&\':\n                tmp = \'&\'\n                x = 6\n                i = start+1\n                while x and i<n:\n                    tmp += text[i]\n                    i += 1\n                    x -= 1\n                    if tmp in d:\n                        res += d[tmp]\n                        start = i\n                        break\n                else:\n                    res += c\n                    start += 1\n            else:\n                res += c\n                start += 1\n\n        return res\n\n```
[]