JS 检测字符串是否还有某个字符

function filer(s)
{
     var str = "字符串";  
    if (str.indexOf(s) == -1) {  
        alert("没有");  
    } else {  
        alert("有");  
    }    
}
原文地址:https://www.cnblogs.com/lbonet/p/7838387.html