我正在读一个文件,每一行如下
Derek Simons, Jason baker
Jack Smith, Rob Thomson
问题出在我的标记器上
StringTokenizer st = new StringTokenizer(line, ",");
while(st.hasMoreTokens()){
System.out.println(st.nextToken());
}
输出是
Derek Simons
Jason baker
Jack Smith
Rob Thomson
我怎样才能摆脱那个额外的空白?这样输出将是
Derek Simons
Jason baker
Jack Smith
Rob Thomson
任何帮助表示感谢!