问题:如何按照空格分割字符串
解决方案:
str = "Hello I'm your String";
String[] splited = str.split("\\s+");
转自:
http://stackoverflow.com/questions/7899525/how-to-split-a-string-by-space
本文介绍了一种使用Java实现的简单方法来按空格分割字符串。通过正则表达式\s+,可以将包含多个连续空格的字符串正确地分割成数组。
问题:如何按照空格分割字符串
解决方案:
str = "Hello I'm your String";
String[] splited = str.split("\\s+");
转自:
http://stackoverflow.com/questions/7899525/how-to-split-a-string-by-space
1928

被折叠的 条评论
为什么被折叠?
