我有一个字符串
var chartDataArrayString = '[0.00,0.00],[0.00,0.00],[0.00,0.00],[0.00,0.00],[0.00,0.00],[0.00,0.00],[0.00,0.00],[0.00,0.00],[0.00,0.00],[0.00,0.00],[8.44,10.55],[51.79,64.74]';
现在我想从这个字符串中提取每个单元并将其放入一个二维数组中。所以二维数组中有 12 个元素,每个元素都有 2 个值。所以它应该看起来像这样
var 2dArray = [[470, 870.45], [560, 920.49], [350, 540.12], [600, 901.59], [500, 750.4], [620, 401], [480, 724.4], [530, 598.98], [630, 630], [400, 876.69], [220, 1100.2], [500, 1021.9]];
我试图用','来分割它,但我发现在每个小单元里面,也有一个','。
先感谢您。