var key = ‘java’;

 var str = "hello,javascript,welcome to my world";

if(key.indexOf(str)!=-1){
                alert('Yes');
            }