最佳答案
我的程序从一个文件中读取一行。这行包含逗号分隔的文本,如:
123,test,444,"don't split, this",more test,1
我希望分手的结果是这样的:
123
test
444
"don't split, this"
more test
1
如果我使用 String.split(",")
,我会得到这个:
123
test
444
"don't split
this"
more test
1
换句话说: 子字符串 "don't split, this"
中的逗号不是分隔符。如何处理这个问题?