标签: java arrays string split
我有一个字符串,
String str = "(A,B),C,D,(E,F,G)"; String[] parts = str.split(",");
我想用逗号分隔,但我需要括号内的逗号
parts[0] = "(A,B)"; parts[1] = "C"; parts[2] = "D"; parts[3] = "(E,F,G)";