我有一个数组:
a = [[676, "/"], [679, "/", 680, "/"], [4, "3.7", "111.55", "/"], [668, "/"], [681, "/", 682, "/"]]
想要有这样的输出:
a = [[676], [679], [680], [4, "3.7", "111.55"], [668], [681], [682]]
尝试过这样的事情:
a.flatten.join(",").split("/")
这给出了这样的东西:
["676,", ",679,", ",680,", ",4,3.7,111.55,", ",668,", ",681,", ",682,"]