之前在http://shukuiyan.iteye.com/blog/507915文中已经叙述过这个问题,但是最近一次笔试中居然有碰到了这个知识点,而且还做错了,囧!学艺不精啊.题目大概是这样的: ); //// 在每个空格字符处进行分解 for(String stemp:stringarray){ System.out.println(stemp); } 输出结果为 this is a about split test 看看下面这个 String ipstring="59.64.159.224…
在java doc里有 String[] java.lang.String.split(String regex) Splits this string around matches of the given regular expression. This method works as if by invoking the two-argument split method with the given expression and a limit argument of zero. Tra…
使用split分割时: String[] a="aa|bb|cc".split("|"); output: [a, a, |, b, b, |, c, c] 先看一下split的用法: String[] java.lang.String.split(String regex) Splits this string around matches of the given regular expression. This method works as if by in…