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); } }
时间: 2024-10-06 19:51:28