Extract text from string

  • Thread starter Thread starter Gary Dolliver
  • Start date Start date
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
 
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"
 
Back
Top