正则表达式将字符串中的所有连续空格替换成一个空格
发布时间:2020-12-14 02:28:47 所属栏目:百科 来源:网络整理
导读:Replace two or more spaces with a single space. JAVA : String oldStr = "AAA BBB"; String newStr = oldStr.replaceAll(" {2,}"," "); JS : var oldStr = "AAA BBB"; var newStr = oldStr.replace(//s{2,}/g," "); SQL : If there two records in table
Replace two or more spaces with a single space. JAVA : JS : SQL : (编辑:李大同) 【声明】本站内容均来自网络,其相关言论仅代表作者个人观点,不代表本站立场。若无意侵犯到您的权利,请及时与联系站长删除相关内容! |