Java截取字符串的

1、全部(6)

获取6的值,,使用字符串中.substring()的方法 截取字符串方法,

String allTest=全部(6);
String allnum = allTest.substring(allTest.indexOf("(")+1, allTest.indexOf(")"));

2、还有拆分字符串方法,split();.replace()等

String[] names = nameStr
        .replace("、",",")
        .replace(":",",")
        .replace(":",",")
        .replace(",",",")
        .split(",");

你可能感兴趣的:(java,开发语言)