String的split()的方法的使用

来源:互联网 发布:企业宣传制作软件app 编辑:程序博客网 时间:2024/06/02 14:33
public   class   CharTest  
  {  
  public   static   void   main(String[]   args)  
  {  
  String   str   =   "abc+efg";  
  String[]   strs   =   str.split("[+]");  
  for(int   i   =   0;   i   <   strs.length;   i   ++)  
  {  
  System.out.println(strs[i]);  
  }  
  }  
  }  
   
  输出:  
  abc  
  efg