String a = "Hola Mundo"; String b = "Hola"; if(a.indexOf(b)!=-1) out.println("si contine la palabra :" + A);