字符串截取:
public class test {
public static void main(String[] args) {
String test = "aaa_bbb_ccc";
System.out.println(test.substring(0, test.indexOf("_")));
System.out.println(test.substring(test.indexOf("_") + 1));
System.out.println(test.substring(test.lastIndexOf("_") + 1));
}
}
结果:
aaa
bbb_ccc
ccc