更新时间:2022-12-11 08:19:25
首先消除多个空格:
String after = before.trim().replaceAll(" +", " ");
然后使用split方法将字符串拆分为您的数组
Then Split the String up into your array using the split method
Java字符串-用一个空格替换多个空格,然后根据空格将字符串拆分为数组