集册 Java实例教程 StringTokenizer

StringTokenizer

欢马劈雪     最近更新时间:2020-01-02 10:19:05

524
提示:您可在线编辑运行本教程的实例 - 运行实例,去试试!
StringTokenizer-返回分隔符和令牌


import java.util.StringTokenizer;

 

public class Main {
/** from 
nowjava**/

 

  public static void main(String[] args) {

    StringTokenizer st = new StringTokenizer("Java|StringTokenizer|Example 1","|");

    while(st.hasMoreTokens())

      System.out.println(st.nextToken("|"));

 

  }

}