I have a string of data which look like this
0E-11 GERBER CA 960350E-110.0215.500000000 0E-12 TEHAMA CA 960900E-11214.800000000
I want to convert this string into an array of arrays.
Please note that after every 4 elements this array should be divided into new array and the end result should look like this:
Desire Results:
this.tblData: Array(2)
0: ["0E-11,"GERBER", "CA", "960350E-110.0215.500000000"]
1:["0E-12", "TEHAMA", "CA" ,"960900E-11214.800000000"]
Thanks
You can use the remainder operator and a forEach loop on that string to build an array of arrays, where each nested array is created every n steps: