java stringtokenizer problem?

2012-11-20 4:26 am
how do I add this symbol " to the delimiter?

StringTokenizer st = new StringTokenizer(str, " " ");

because this wouldn't work.

回答 (1)

2012-11-20 4:30 am
✔ 最佳答案
you need to escape the quote (although that's not really adding to the String tokenizer--to truly "add" things you need to use regular expressions):

String st = new StringTokenizer(str, "\"");


收錄日期: 2021-05-01 14:46:52
原文連結 [永久失效]:
https://hk.answers.yahoo.com/question/index?qid=20121119202645AAVhZVi

檢視 Wayback Machine 備份