正则表达式分割字符串

String name = "a}b}bbb}g";
Pattern p = Pattern.compile("}");
String[] strs = p.split(name, 3); //数组长度为3

相关推荐