{"ScriptPreparationCode":null,"TestCases":[{"Name":"arraysplit","Code":"const string = \u0027test machine name\u0027;\r\nconst tokens = [];\r\nconst maxLength = 40;\r\nlet workingString = \u0022\u0022;\r\nstring.split(\u0022 \u0022).forEach((str) =\u003E {\r\n if (str.length \u003E maxLength || str.length \u002B workingString.length \u003E maxLength) {\r\n tokens.push(workingString);\r\n tokens.push(str);\r\n workingString = \u0027\u0027;\r\n }\r\n else{\r\n workingString \u002B= str;\r\n }\r\n});\r\n","IsDeferred":false},{"Name":"bruteforce","Code":"const string = \u0027test machine name\u0027;\r\nconst tokens = [];\r\nconst maxLength = 40;\r\nlet workingString = \u0022\u0022;\r\n\r\nfor (let index = 0; index \u003C string.length; index\u002B\u002B) {\r\n const element = string[index];\r\n \r\n if(element == \u0027 \u0027 \u0026\u0026 workingString.length \u003E= maxLength){\r\n tokens.push(workingString);\r\n workingString = \u0027\u0027;\r\n }\r\n else{\r\n workingString \u002B= element;\r\n }\r\n}","IsDeferred":false}]}