contains方法

contains方法,表示判断是否有当前字符串,有为true,没有为false;

String str ="今天的菜谱有:QQ,当地,单独,方法,额额,混合,存储,最终,看看。";
        System.out.println(str);
        boolean request1 = str.contains("单独");
        System.out.println("查询是否包含单独字段"+request1);
结果为:true;
原文地址:https://www.cnblogs.com/bellwether/p/10177956.html