js将字符串'ALD001022100494'、'ALD001022100494,ALD001022100494'、'ALD001022100494,ALD001022100494,ALD001022100494'等以','分割成数组
时间: 2024-01-27 09:06:12 浏览: 68
艾兰德ALD2400V变频器使用手册
可以使用JavaScript中的split()方法将字符串以逗号为分隔符分割成数组。具体实现方法如下:
```
var str = 'ALD001022100494,ALD001022100494,ALD001022100494';
var arr = str.split(',');
console.log(arr);
```
运行结果为:
```
["ALD001022100494", "ALD001022100494", "ALD001022100494"]
```
阅读全文