[C++] code
\n```\nclass Solution {\npublic:\n    \n    int fun(string s)\n    {\n        if(s=="&quot")\n            return 0;\n        else if(s=="&apos")\n            re
\n```\nclass Solution {\npublic:\n    \n    int fun(string s)\n    {\n        if(s=="&quot")\n            return 0;\n        else if(s=="&apos")\n            return 1;\n        else if(s=="&amp")\n            return 2;\n        else if(s=="&gt")\n            return 3;\n        else if(s=="&lt")\n            return 4;\n        else if(s=="&frasl") \n            return 5;\n        else return -1;\n    }\n    \n    string entityParser(string text) {\n        char d = 34;\n        string p = "";\n        p+=d;\n        vector<string> v = {p, "\'", "&", ">", "<" , "/"};\n        string ans = "";\n        for(int i=0;i<text.length();i++)\n        {\n            if(text[i]==\'&\')\n            {\n                string s = "";\n                while(i<text.length() && text[i]!=\';\')\n                {\n                    s+= text[i];\n                    i++;\n                }\n                if(fun(s)==-1)\n                {\n                    s+= \';\';\n                    ans+= s;\n                }\n                else\n                    ans += v[fun(s)];\n            }\n            else\n            {\n                ans += text[i];\n            }\n        }\n        return ans;\n    }\n};
[]