提示:您可在线编辑运行本教程的实例 - 运行实例,去试试!
StringTokenizer返回令牌作为对象
/**N o w J a v a . c o m**/ import java.util.StringTokenizer; public class Main { public static void main(String[] args) { StringTokenizer st = new StringTokenizer("Java StringTokenizer Example"); while(st.hasMoreElements()){ System.out.println(st.nextElement()); } } }