{"ScriptPreparationCode":"var str = \u0022this is a string with speci\u00E5l ch\u00E4r\u00E4cters to rem\u00F6ve\u0022;\r\nvar badchars = [\u0027\u00E5\u0027, \u0027\u00E4\u0027, \u0027\u00F6\u0027];\r\n\r\nfunction removeChars1 (str, badchars) {\r\n return str.split(\u0022\u0022).filter((chr) =\u003E badchars.indexOf(chr) === -1).join(\u0022\u0022);\r\n}\r\n\r\nfunction removeChars2 (str, badchars) {\r\n return str.replace( new RegExp(\u0022(\u0022 \u002B badchars.join(\u0027|\u0027) \u002B \u0022)\u0022, \u0022g\u0022), \u0022\u0022 );\r\n}\r\n","TestCases":[{"Name":"Using split \u002B filter \u002B join","Code":"var final = removeChars1(str, badchars);","IsDeferred":false},{"Name":"Using RegExp global replace","Code":"var final = removeChars2(str, badchars);","IsDeferred":false}]}