下面的字符串改成数组用js应该怎么做Attached2023625202362515349jpgAttached2023625202362515351jpg
可以使用split()方法将字符串按照指定的分隔符转换成数组,代码如下:
var str = "/Attached/2023/6/25/202362515349.jpg,/Attached/2023/6/25/202362515351.jpg";
var arr = str.split(",");
console.log(arr);
运行结果为:
["/Attached/2023/6/25/202362515349.jpg", "/Attached/2023/6/25/202362515351.jpg"]
原文地址: https://www.cveoy.top/t/topic/hrIq 著作权归作者所有。请勿转载和采集!