标签:style blog color strong cti io
给字符串的字符和数字间加上空隔
var str = ‘a23dssf12ldf2lf4‘; function addSplit(str){ var reg = /(\D+)/g; var str = str.replace(/(\d+)/g, ‘ $1 ‘); return str.replace(/^\s+|\s+$/g,‘‘); } alert(addSplit(str));
标签:style blog color strong cti io
原文地址:http://www.cnblogs.com/cybhgx/p/3811899.html