62,620
社区成员
发帖
与我相关
我的任务
分享
谢谢is_zhoufeng!
String str = "你好,\"我们,是一,块,的\",HEllo,World,\"我们,也是,一块的\"";
boolean fh = false ;
StringBuilder sb = new StringBuilder();
for (int i = 0; i < str.length(); i++) {
char c = str.charAt(i);
if('\"' == c){
fh = !fh ;
}
if(c == ',' && !fh){
System.out.println(sb.toString());
sb.delete(0, sb.length());
}else{
sb.append(c);
}
}
System.out.println(sb.toString());