JS 拆分字符串,并按需求进行拼装 示例
var brands = new Array(); //创建数组
var dates = "1111&2222&3333&4444&5555&6666&7777"; //定义字符串
var dtNum = dates.split("&").length; //取得字符串长度
brands = dates.split("&"); //为数组负值
for (i = 0; i < dtNum; i++) {
document.write(brands[i]); //打印数组
}