【发布时间】:2013-09-21 05:22:01
【问题描述】:
能否请您告诉我有没有办法在java或spring中用单个空格替换多个空格?有相同的 stringUtils 函数吗?
喜欢
1.
test test
test test
2.
test test
test test
3.
test test
test test
【问题讨论】:
-
字符串实用程序的问题是它们不会替换可变长度的字符,因此您必须默认为单个字符。但这样做最终会花费大量时间。最好使用正则表达式。