how to implement Java String's indexOf function in my javascript
Hi,
i want to implement Java String's indexOf function in my javascript.
javacode:
String s1= "abc";
Sring s2 = "xyzabcxyz";
if((s2.indexOf(s1))==-1)
{ return;}
i want to implement the same logic in my javascript
where string s1 given by --document.form1.s1.value
string s2 given by --document.form2.s2.value
how can i use indexof method here?can anyone please tell me
i tried with this but its not working
if((document.form1.s1.value.indexOf(document.form2.s2.value))==-1)
{ alert ("s2 not found in s1");}