split "|" notes in java

来源:互联网 发布:matlab 遗传算法 袋鼠 编辑:程序博客网 时间:2024/06/05 08:06
split("|"), this won't work, it will split each char. but you can use token
 StringTokenizer st = new StringTokenizer("bt|ks","|");
  while (st.hasMoreTokens()) {
   System.out.println(st.nextToken());
  }
  
  
  
  or split("\\|")
原创粉丝点击