检查字符串里是否包含*

来源:互联网 发布:人工智能 服务业 编辑:程序博客网 时间:2024/04/30 07:29
String s = "1212*1212";
if(s.indexOf("*") != -1){
   System.out.println("该字符串里包含*");
}