if(Str.indexOf (oldStr)>-1 )
{
while (Str.indexOf (oldStr,n )>-1 )
{
i=Str.length();
if(Str.indexOf (oldStr)==0 )
Str=newStr+Str.substring(j ,i );
else
{
t=Str.indexOf (oldStr);
m=(t+j );
Str=Str.substring (0 ,t )+newStr+Str.substring (m ,i );
n=t+newStr.length ()-j+1;
}
}
}
ReturnStr=Str ;
return ReturnStr;
}
//——ubb 替换——
public String LCReplace (String Str,String BStr ,String EStr ,
String ReStr)
{
String ReturnStr="" ,Str1="" ,Str2="" ;
int i ,j ,n ;
n=0 ;
if((Str.indexOf (BStr)>-1 )&&((Str.indexOf (EStr)>-1 )))
{
while (Str.indexOf (BStr,n )>-1 )
{
i=Str.indexOf (BStr);
j=Str.indexOf (EStr);
Str1=Str.substring((i+BStr.length ()),j );
Str2=ebbReplace (ReStr ,"$lichao$",Str1);
Str1=BStr+Str1+EStr ;
Str=ebbReplace(Str ,Str1,Str2);
n=i+Str2.length ()-Str1.length();
}
}
ReturnStr=Str ;
return ReturnStr;
}
}