1. 程式人生 > >字符串去空返回數組

字符串去空返回數組

ring 返回 index obj dex bst substring length lastindex

var index=item.lineName.lastIndexOf(" ");//去空格 var obj=item.lineName.substring(index+1,item.lineName.length); console.log(obj.split(/-/),‘22222‘) this.applicantAddress=obj.split(/-/)[0]; this.communityName=obj.split(/-/)[1];

字符串去空返回數組