public class D {
public static void main(String[] args) {

String b = "Hello Java World";
System.out.println("原字符串:"+b);
/*把字符串转化为数组形式,并用正则表达式进行分割*/
String [] c = b.split("\\s+");
for (String ss : c){
System.out.println(ss);
}
}
posted on 2018-05-31 11:10  背起全世界の蜗牛  阅读(14868)  评论(0编辑  收藏  举报