//字符串 var str = "12132434ddddftest";
//用indexOf方法判断是否包含test字符串
var iscontaintest = str.indexOf("test")==-1?false:true;