Showing posts with label how to replace hexadecimal values with special characters in vugen scripts. Show all posts
Showing posts with label how to replace hexadecimal values with special characters in vugen scripts. Show all posts

Thursday, 11 August 2016

Replace function used Vugen scripts

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,"&#x21", "!","c_ESS_New");