2
Reply

Can you write a program for find a string in a given string (string search) in JavaScript ?

    we can use function fnStrInStr(myStrVal,srchStr) {if(fnStrInStr.indexOf(srchStr)>0) {alert('String found');} else{alert('String Not found');} }

    use searchstring.lastIndexOf('string to be search') > -1