{"ScriptPreparationCode":null,"TestCases":[{"Name":"regex","Code":"(\u0022this is foo bar\u0022.match(/o/g)||[]).length","IsDeferred":false},{"Name":"split","Code":"\u0022this is foo bar\u0022.split(\u0022o\u0022).length-1","IsDeferred":false},{"Name":"for loop1","Code":"var stringsearch = \u0022o\u0022;\r\nvar str = \u0022this is foo bar\u0022;\r\nfor(var count=-1,index=-2; index != -1; count\u002B\u002B,index=str.indexOf(stringsearch,index\u002B1) );","IsDeferred":false},{"Name":"for loop 2","Code":"var stringsearch = \u0022o\u0022;\r\nvar str = \u0022this is foo bar\u0022;\r\nfor(var i=count=0; i\u003Cstr.length; count\u002B=\u002B(stringsearch===str[i\u002B\u002B]));","IsDeferred":false},{"Name":"deleting","Code":"var str = \u0022this is foo bar\u0022;\r\nstr.length - str.replace(/o/g,\u0027\u0027).length;","IsDeferred":false},{"Name":"histogram","Code":"var str = \u0022this is foo bar\u0022;\r\nvar schar = \u0027o\u0027;\r\nvar hist={}; \r\nfor(si in str){\r\n hist[str[si]] = hist[str[si]] ? 1\u002Bhist[str[si]]:1;\r\n}","IsDeferred":false}]}