char *strSource;
void Replace( char *strSource, char *strFrom, char *strTo, char *strParam)
{
char strTemp[1024];
char *s= (char *)strSource;
int i=0;
int iLenFrom = strlen (strFrom);
int iLenTo = strlen(strTo);
while(*s)
{
if(strncmp (s,strFrom, iLenFrom) ==0)
{
strncpy(&(strTemp[i]), strTo, iLenTo);
i+=iLenTo;
s+ =iLenFrom;
}
else
{
strTemp[i++] =*s;
s++;
}
}
strTemp[i] =0;
lr_save_string(strTemp,strParam);
}
//how to call replace function
strSource= lr_eval_string("{c_ESS}");
lr_save_string(strSource,"c_ESS_New");
Replace(strSource,"!", "!","c_ESS_New");
No comments:
Post a Comment