你要用s来区分的话还用两上反斜线干什么?!S也不是特殊的字符!!String[] result = "this is a test".split("s");
for (int x=0; x<result.length; x++)
    System.out.println(result[x]);

解决方案 »

  1.   

    Copy from JDK 1.4 API docs
    =============================================================
    The limit parameter controls the number of times the pattern is applied and therefore affects the length of the resulting array. If the limit n is greater than zero then the pattern will be applied at most n - 1 times, the array's length will be no greater than n, and the array's last entry will contain all input beyond the last matched delimiter. If n is non-positive then the pattern will be applied as many times as possible and the array can have any length. If n is zero then the pattern will be applied as many times as possible, the array can have any length, and trailing empty strings will be discarded. 需要找个翻译么?
      

  2.   

    limit 应该是要分割几次,如果limit为5,那么会分割4次
      

  3.   

    split的参数是正则表达式,在正则中"\s"代表空白字符,如果你想按s分割请用split("s")
    limit的作用请看jdk的文档吧,楼上有人贴出来了
      

  4.   

    limit是指最多找到几个部分,再多也不分开了!