Java拆分字符串返回数组

private String[] splitSkins(String content,String flag){


      StringTokenizer toKenizer = new StringTokenizer(content,flag);


       String[] str = new String[toKenizer.countTokens()];


      for(int i=0;i<toKenizer.countTokens();i++){


            str[i] = toKenizer.nextToken();


      }


      return str;


}

你可能感兴趣的:(java)