文章详情页
Java。如何在第n个空格上分割多个空格的字符串?
浏览:69日期:2024-04-29 11:45:57
如何解决Java。如何在第n个空格上分割多个空格的字符串??
您可以这样做:
String[] stringArray = string.split('(?<!GS+)s');解决方法
这是我打算拆分为数组的示例字符串:
Hello My Name Is The Mighty Llama
输出应为:
Hello MyName IsThe MightyLlama
下面在每个空间上拆分,我如何在每个其他空间上拆分?
String[] stringArray = string.split('s');
标签:
java
相关文章:
排行榜
