I want to truncate email addresses generated by my application to only the characters before "@" e.g.instead of "firstname.lastname@example.org", I would like to output "joe_blow".
I am able to get the whole email address with getcelldata, but I am stuck on how to truncate it. Trimming has not worked
Find the position of the "@" using "InStr", then use "Left" to return number of desired numner of chars in the original address. The "length" input to "Right" would be equal to the position of the "@" - 1.
If ya got beef then fool eat a pork chop.
The number of characters before the "@" varies from email address to email address. The domains, i.e. after the "@", are also different
I have not failed. I've just found 10,000 ways that won't work" --Thomas Edison
Var = "email@example.com"
Temp = Split(Var,"@")
Msgbox Temp(0) ' This will give joe_blow
That's why you use InStr
simplest solution would be
emailID = "firstname.lastname@example.org"
Tarun Buy the NEW QTP Descriptive Programming Unplugged Book ** Download QTP Unplugged 2nd Edition eBook for FREE **
Worked like a charm! Thanks a million