Extract text from string

G

Gary Dolliver

Hello,
How would I go about pulling text out of a long string? The length will
vary, but I know exactly what will preceed the text I need, and also the
length of the text I need to extract. For example, I have the following
string returned to me:
abcdefghijklmnopqrstuvwxyz&transaction=XXXXXX&code2=1234567890
I would like to pull out XXXXXX from this string and was hoping I could use
"transaction=" as a reference point? Help would be greatly appreciated,
thanks
-gary
 
F

fredg

Hello,
How would I go about pulling text out of a long string? The length will
vary, but I know exactly what will preceed the text I need, and also the
length of the text I need to extract. For example, I have the following
string returned to me:
abcdefghijklmnopqrstuvwxyz&transaction=XXXXXX&code2=1234567890
I would like to pull out XXXXXX from this string and was hoping I could use
"transaction=" as a reference point? Help would be greatly appreciated,
thanks
-gary


You wish to extrract the 6 characters after "transaction="?
"Transacgtion=" is 12 characters so you wish to get the 6 characters
starting at the 13th position after the first "t" in "transaction=".

=Mid([FullString],InStr([FullString],"transaction=")+13,6)
will find "XXXXXX"
 

Ask a Question

Want to reply to this thread or ask your own question?

You'll need to choose a username for the site, which only take a couple of moments. After that, you can post your question and our members will help you out.

Ask a Question

Top