java编程之:org.apache.commons.lang3.text.StrTokenizer
第一个api测试:按特殊符号进行分词,并遍历每一个分词部分
![](https://images.cnblogs.com/OutliningIndicators/ContractedBlock.gif)
1 public static void main(String[] args) { 2 String aString="AB-CD-EF-GH-IJ-KL-MN-OP-QR-ST-UV-WX-YZ"; 3 StrTokenizer strTokenizer=new StrTokenizer(aString, "-"); 4 while(true){ 5 System.out.println("PaymentModeCodeServiceImpl.main()"+strTokenizer.nextToken()); 6 boolean flag=strTokenizer.hasNext(); 7 if(!flag){ 8 break; 9 } 10 } 11 }