function replaceX(strMaster,strA,strB)
{
var startIndex,lengthA,firstPart,lastPart,resultPart;
startIndex=strMaster.indexOf(strA);
if (startIndex>=0)
{
firstPart=strMaster.substr(0,startIndex);
lengthA=strA.length;
lastPart=strMaster.substr(startIndex+lengthA,strMaster.length-(startIndex+lengthA)+1);
resultPart=firstPart+strB+lastPart;
startIndex=resultPart.indexOf(strA);
if(startIndex>=0)
{
return replaceX(resultPart,strA,strB);
}
else
{
return resultPart;
}
}
else
{
return strMaster;
}
}
{
var startIndex,lengthA,firstPart,lastPart,resultPart;
startIndex=strMaster.indexOf(strA);
if (startIndex>=0)
{
firstPart=strMaster.substr(0,startIndex);
lengthA=strA.length;
lastPart=strMaster.substr(startIndex+lengthA,strMaster.length-(startIndex+lengthA)+1);
resultPart=firstPart+strB+lastPart;
startIndex=resultPart.indexOf(strA);
if(startIndex>=0)
{
return replaceX(resultPart,strA,strB);
}
else
{
return resultPart;
}
}
else
{
return strMaster;
}
}