DESKTOP-S9OHBDA_20200828-王东东
问题:
1.java中怎么判断字符串里有没有指定的字符存在?
public static void main(String[] args) {
String str = "wddconfig";
if(str.indexOf("d")!=-1){
System.out.println("存在");
}else{
System.out.println("不存在!");
}
}
解决了
吐槽:
点赞