{"ScriptPreparationCode":null,"TestCases":[{"Name":"splitstring","Code":" function splitString(str = \u0022\u0022, splitter = \u0022\u0022, includeSplitter = false) {\r\n function getlast(string, len) {\r\n if (len \u003E string.length) return -1;\r\n let s = \u0022\u0022;\r\n let o = string.length - 1 - len;\r\n for (let i = string.length - 1; i \u003E o; i--) {\r\n s = string[i] \u002B s;\r\n }\r\n return s;\r\n }\r\n\r\n if (typeof str !== \u0022string\u0022 || typeof splitter !== \u0022string\u0022) return str;\r\n if (!str.length) return [str];\r\n let strPieces = [];\r\n if (!splitter.length) {\r\n for (let p = 0; p \u003C str.length; p\u002B\u002B) {\r\n strPieces.push(str[p]);\r\n }\r\n return [...strPieces];\r\n }\r\n\r\n let splitterLen = splitter.length;\r\n let strCurPiece = \u0022\u0022;\r\n let tempStr = \u0022\u0022;\r\n for (let v = 0; v \u003C str.length; v\u002B\u002B) {\r\n strCurPiece \u002B= str[v];\r\n if (strCurPiece.length \u003C splitterLen) continue;\r\n //let lastchars = strCurPiece.last(splitterLen);\r\n\r\n let lastchars = getlast(strCurPiece, splitterLen);\r\n if (lastchars !== splitter) continue;\r\n if (includeSplitter) {\r\n strPieces.push(strCurPiece);\r\n strCurPiece = \u0022\u0022;\r\n continue;\r\n }\r\n\r\n let lenny = strCurPiece.length - splitterLen;\r\n for (let y = 0; y \u003C lenny; y\u002B\u002B) {\r\n tempStr \u002B= strCurPiece[y];\r\n }\r\n strPieces.push(tempStr);\r\n strCurPiece = \u0022\u0022;\r\n tempStr = \u0022\u0022;\r\n }\r\n\r\n if (strCurPiece.length) strPieces.push(strCurPiece);\r\n return [...strPieces];\r\n }\r\n\r\nsplitString(\u0027dfasfasfaqqq\u0027,\u0027qqq\u0027)","IsDeferred":false},{"Name":"split","Code":"\u0027dfasfasfaqqq\u0027.split(\u0027qqq\u0027)","IsDeferred":false}]}