
Java
Javascriptconst RegEx = /bw+b/;const str = "This is a sample text with some Chinese spaces between English words. 1^p2^1^1^1^1^1^1^1^1^1^1^1^1^1^1^1^1^1^1^1^1^1^1^1^1^1^1^1^1";const result = str.replace(RegEx, "");console.log(result);输出结果为:"Thisisasampletextwithsomechinesespacesbetweensemanticwords.1^p2^1^1^1^1^1^1^1^1^1^1^1^1^1^1^1^1^1^1^1^1^1^1^1^1^1^1^1"通过以上方法,就能去掉英文单词前面的中文空格,并保留其他字符和空格。希望能对您有所帮助。如果还有其他问题,欢迎继续咨询。Copyright © 2025 IZhiDa.com All Rights Reserved.
知答 版权所有 粤ICP备2023042255号