i need to write a function to remove consecutive slashses from a string
i wrote this
for( i=0; i!=b; )
{
var slashone = strname.indexOf('/',i+1)
i=slashone
var slashtwo = strname.indexOf('/',i+1)
i=slashtwo
//alert("index of slash one" + slashone)
//alert("index of slash two" + slashtwo)
if( slashone == (slashtwo-1))
{
alert("Remove Consecutive Slashes")
// form..focus();
form.NAME.focus();
return false;
}
// break;
}
this works only for the first occurence
not there after
ie it works for a//b
but doesn't work for a//b//c