java 分割字符串后放入List中
public static void main(String[] args) { String str="单机游戏,网络游戏,小游戏"; List<String> list=new ArrayList<String>(); StringTokenizer st=new StringTokenizer(str,","); while(st.hasMoreTokens()){ list.add(st.nextToken()); } for(String s:list){ System.out.println(s); } }