String str = "123:456";
判断字符串中是否包含某个字符:
if(str.indexOf(":")!=-1){
System.out.println("包含");
}else{
System.out.println("不包含");
}
切割字符串:
String[] split = str.split(":");
转载于:https://blog.51cto.com/liuxudong1001/1730046