preg_replace("/(\s|\ \;| |\xc2\xa0)/", "", strip_tags($str)) ...
preg_replace("/(\s|\ \;| |\xc2\xa0)/", "", strip_tags($str)) ...
如果直接使用replace(" ","")则只能替换一个空格 ...
function removeAllSpace(str) { return str.replace(/\s+/g, ""); } ...
有的中文的半角,圆角空格或者段落符显示为空白的。可以用正则来处理 preg_replace("/(\s|\ \;| |\xc2\xa0)/","",$content); ...
string get_string(string res){ //删除换行符 int r = res.find('\r\n'); while (r != string::npos) { if (r != string::npos ...
name.replace(/\s+/g,""); ...
结果:杭州,上海,合肥 ...
name.replace(/\s+/g,""); ...