var text = 这是一个\n文本\t.”;Runtime:
text = text.replace(/ /g,'');
console.log(文本);
thisestun字符 g 定义了整个字符串中搜索的重复次数。此正则表达式删除了空格,但留下了换行符和 \t.
text.
text = text.replace(/\s/g,'');执行:
thisisuntext.
Please disable your ad blocker and refresh the window to use this website.