作者热门文章
- iOS/Objective-C 元类和类别
- objective-c - -1001 错误,当 NSURLSession 通过 httpproxy 和/etc/hosts
- java - 使用网络类获取 url 地址
- ios - 推送通知中不播放声音
<分区>
我想拆分必须符合 csv 语法但文本包含逗号的文本
例子:帐户 ID 标题文本
String line = "account123,2222,Thnaks for reaching out,\"Hey [[customerFirstName]], Thanks for reaching out to us.\""
String[] splitted = line.split(",");
结果:
splitted = {String[5]@539}
0 = "account123"
1 = "2222"
2 = "Thnaks for reaching out"
3 = ""Hey [[customerFirstName]]"
4 = " Thanks for reaching out to us.""
但我希望
splitted = {String[4]@539}
0 = "account123"
1 = "2222"
2 = "Thnaks for reaching out"
3 = "Hey [[customerFirstName]], Thanks for reaching out to us.\"
我是一名优秀的程序员,十分优秀!