{"ScriptPreparationCode":"var strIn = \u0027https://site.com/?this=a\u002Btest\u0026that=just\u002Bit#home\u0027;\r\nvar strOut = \u0027\u0027;\r\nvar regex = /\\?.*$/;\r\nvar regex2 = /#.*$/;\r\n\r\nvar regexAll = /(\\?.*|#.*)$/;","TestCases":[{"Name":"Multiple Regex replaces","Code":"strOut = strIn.replace(regex, \u0027\u0027).replace(regex2, \u0027\u0027);","IsDeferred":false},{"Name":"indexOf replace","Code":"var idx = strIn.indexOf(\u0027?\u0027);\r\n\r\nif (idx \u003E= 0) {\r\n strOut = strIn.slice(0, idx);\r\n}\r\n\r\nvar idx2 = strIn.indexOf(\u0027#\u0027);\r\n\r\nif (idx2 \u003E= 0) {\r\n strOut = strIn.slice(0, idx2);\r\n}","IsDeferred":false},{"Name":"substring replace","Code":"var idx = strIn.indexOf(\u0027?\u0027);\r\n\r\nif (idx \u003E= 0) {\r\n strOut = strIn.substring(0, idx);\r\n}\r\n\r\nvar idx2 = strIn.indexOf(\u0027?\u0027);\r\n\r\nif (idx2 \u003E= 0) {\r\n strOut = strIn.substring(0, idx2);\r\n}","IsDeferred":false},{"Name":"Regex with OR","Code":"strOut = strIn.replace(regexAll, \u0027\u0027);","IsDeferred":false}]}