{"ScriptPreparationCode":"var str = \u0027ABCD EFG HIJKLMN OP QR STU V W XYZ\u0027;\r\nvar strLength = str.length;\r\nvar matchCountRegExp = /\\S/g;\r\nvar replacedTextRegExp = /\\s/g;","TestCases":[{"Name":"Regex match count","Code":"str.match(matchCountRegExp).length;","IsDeferred":false},{"Name":"Get replaced text length with regex","Code":"str.replace(replacedTextRegExp, \u0027\u0027).length;","IsDeferred":false},{"Name":"Get replaced text length with String.replaceAll()","Code":"str.replaceAll(\u0027 \u0027, \u0027\u0027).length;","IsDeferred":false},{"Name":"Get replaced text length with String.split()","Code":"str.split(\u0027 \u0027).join(\u0027\u0027).length;","IsDeferred":false},{"Name":"Calculate with String.split()","Code":"str.length - str.split(\u0027 \u0027).length \u002B 1;","IsDeferred":false},{"Name":"Calculate in simple for loop","Code":"let count = 0;\r\nfor (let i=0; i \u003C strLength; i\u002B\u002B) {\r\n if (str[i] !== \u0027 \u0027) count\u002B\u002B\r\n}","IsDeferred":false}]}