Void lr_custom_string_delim_save (char inputstr[500], char* outputstr, char * Delim, int occrno, int stringside) { char *temp, *temp2; char temp3[500] = {0}; int i = 0; int i2; int iOccrNo = 1; temp = ""; while (temp!=null) { if (i==0) &NBSP;{&NBSP;&NBSP;&NBSP;&NBSP;&NBSP;&NBSP;&NBSP;&NBSP;&NBSP;&NBSP;&NBSP;&NBSP;TEMP2 = temp; temp = ( char *) strtok (Inputstr,delim); i++ ; } if (i>0) { temp2 = temp; temp = (char *) strtok (Null,delim); if (stringside==0) { if (ioccrno > Occrno) { strcat (TEMP3,&NBSP;TEMP2); if (temp!=null) { strcat (Temp3, delim); } } } if (stringside==1) { if (Ioccrno <= occrno) { strcat (TEMP3,&NBSP;TEMP2); &Nbsp; strcat (Temp3, delim); } } iOccrNo++; } } if (stringside==1) { for ( i2 = strlen (Temp3) - 1; i2 >= 0 && strchr ( delim, temp3[i2] ) != NULL; i2-- ) temp3[i2] = '; ' } lr_save_string (TEMP3,OUTPUTSTR);} Action () {lr_save_string ("[Email protected]@[email protected] m bhatt", "InputName"); Lr_output_message ("String =%s before Substitution", lr_eval_string ("{inputname}")); Lr_custom_string_delim_save ("{ InputName} ")," test "," @ ", 3,1), Lr_output_message (" replaced string =%s ", Lr_eval_string (" {test} ")); return 0;}
shenzhen Hubei Software test Group 275212937
LoadRunner using C language to implement custom character occurrences to intercept corresponding strings