我有一段多年來一直工作的代碼。調試後,我意識到最後一個令牌不能正確收集。我想是因爲他的長度(超過10k字)。 代碼: StringTokenizer tokens = new StringTokenizer(myString,"&&&&&&&");
(...)
String s=tokens.nextToken();
//Do something with s
s=tokens.nextT
System.out.println("Please input the elements and seperate each by a comma.");
e = dk.nextLine();
String[] elems = new String[e.length()];
st = new StringTokenizer(e,",");
for (int i = 0; i<e.len
5023971 s 2016-05-22 21:34:48
5023971 s 2016-05-22 21:35:57
5023971 s 2016-05-22 21:36:35
5023971 s 2016-05-22 21:37:42
5023971 s 2016-05-22 21:39:41 3 sple
5296256 d
我想忽略使用字符串標記器的特殊字符,如, " ; :。 例如,如果我輸入: He said, "That's not a good idea."
輸出應該是: He
Said
that
s
not
a
good
idea
這是我當前的代碼 class Q_03
{
public static void main(String[] argv)
{