lr function or C code to remove commas from number (eg: 10,22,30)

314 views
Skip to first unread message

Sirajuddin Mohammed

unread,
Apr 25, 2016, 11:31:27 AM4/25/16
to LoadRunner
Hello All,

I have a situation where I need to remove the commas from the number (eg: 10,22,30) which was captured by correlation function and pass onto the URL.
pls let me know if any know solution or how would you handled it, appreciate your help.



Thanks
S

Mangipudi naga satya srikanth

unread,
Apr 25, 2016, 12:50:17 PM4/25/16
to LR-Loa...@googlegroups.com

Use instr function and cascade the string array

--
You received this message because you are subscribed to the Google Groups "LoadRunner" group.
To unsubscribe from this group and stop receiving emails from it, send an email to LR-LoadRunne...@googlegroups.com.
To post to this group, send email to LR-Loa...@googlegroups.com.
Visit this group at https://groups.google.com/group/LR-LoadRunner.
To view this discussion on the web visit https://groups.google.com/d/msgid/LR-LoadRunner/e51af2a4-2b19-4dbd-990b-2a98e2bcc5ba%40googlegroups.com.
For more options, visit https://groups.google.com/d/optout.

Sagar Aggarwal

unread,
Apr 25, 2016, 12:50:18 PM4/25/16
to LR-Loa...@googlegroups.com

Use strtok function

Regards,
Sagar Aggarwal
Technical Testing Lead | Infosys Limited | Chandigarh
(M) +917875624650

--

Mangipudi naga satya srikanth

unread,
Apr 25, 2016, 5:38:19 PM4/25/16
to LR-Loa...@googlegroups.com

Yes strtok..earlier instr wastypo..

André Luyer

unread,
Apr 27, 2016, 9:52:20 AM4/27/16
to LoadRunner
I don't understand why splitting up a string into sub strings using strtok is considered the solution.
Just removing the commas is easier.

char *delcomma(char *str)
{
    char *p, *q;
    for (= q = str; *p; p++) if (*!= ',') *q++ = *p;
    *= 0;
    return str;    
}

Save the new value like this:
lr_save_string(delcomma(lr_eval_string("{param}")), "number");

Using (isdigit(*p)) instead of (*!= ',') removes all non-digits.

André

Surendra Gupta

unread,
May 24, 2016, 10:21:17 AM5/24/16
to LoadRunner
by using strtok()
Reply all
Reply to author
Forward
0 new messages