Find centralized, trusted content and collaborate around the technologies you use most.
Teams
Q&A for work
Connect and share knowledge within a single location that is structured and easy to search.
JavaまたはSpringで複数のスペースを単一のスペースに置き換える方法はありますか? 同じためのstringUtils関数はありますか?
お気に入り
1.
test test test test
2.
3.
これは @pswg のバリエーションです - 改行を無視しますが、それでもタブなどを取得します。
output = input.replaceAll("[^\\S\\r\\n]+", " ");