如何删除字符串之间的空格
我有下面的字符串
string = "Book Your Domain And Get\n \n\n \n \n \n Online Today."
string = str.replace("\\s","").trim();
哪个返回
str = "Book Your Domain And Get Online Today."
但想要的是
str = "Book Your Domain And Get Online Today."
我尝试过许多正则表达式,也谷歌了,但没有运气。并没有找到相关的问题,请帮忙,提前致谢