Is there any C function available equivalent to VB mid function?
Var = "SQA Forums LoadRunner"
We can use strtok function, but I just want to know are there any direct functions available in C?
Appreciate any help from you guys.
(I learned (stole) this from another developer I was working with!)
lr_save_var(mystr + 5, 6, 0, "SubPiece");
Really cool related trick:
char *p1, *p2;
mystr = "ABC=1234?DEF=2221";
// let's say I want to extra the 1234 from this
p1 = strstr(mystr, "=") + 1;
p2 = strstr(p1, "?");
lr_save_var(p1, p2 - p1, 0, "ABCVal");
// note: in LR you will have to case strstr to char *
// if you do not provide a declaration of it.
Unless you are writing a compiler, strtok is NOT the answer.
QAF is still an exercise in self-sufficiency! (Thank JB!)
Both the solutions are really cool.
These two little gems should go in the code share so they don't get lost. Very nifty. [img]/images/graemlins/smile.gif[/img]
You're not paranoid if they really are out to get you.
Hi GM!! Thanks for the positive comment! I have posted it over to the Code Share thread.
Also, thanks to SP from whom I liberated this code!!