java判断某一字符串是否包含另一个字符串

  String str="ABC_001";
if(str.indexOf("ABC")!=-1){
System.out.println("包含");
}else{
System.out.println("不包含");
}

猜你喜欢

转载自blog.csdn.net/cgt_0812/article/details/75115974