LoadRunner using C language to implement custom character occurrences to intercept corresponding strings

Source: Internet
Author: User
Tags strtok

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

Contact Us

The content source of this page is from Internet, which doesn't represent Alibaba Cloud's opinion; products and services mentioned on that page don't have any relationship with Alibaba Cloud. If the content of the page makes you feel confusing, please write us an email, we will handle the problem within 5 days after receiving your email.

If you find any instances of plagiarism from the community, please send an email to: info-contact@alibabacloud.com and provide relevant evidence. A staff member will contact you within 5 working days.

A Free Trial That Lets You Build Big!

Start building with 50+ products and up to 12 months usage for Elastic Compute Service

  • Sales Support

    1 on 1 presale consultation

  • After-Sales Support

    24/7 Technical Support 6 Free Tickets per Quarter Faster Response

  • Alibaba Cloud offers highly flexible support services tailored to meet your exact needs.