need help with the mid and instr functions

I'm trying to use the mid and instr functions to pull a substring from a string like this example:

"JTTTT0645T383"TUCKER, JAMmES"9999999999999999999999999""6/27/2037"""1/1/1900""

I would like to receive this value:
JTTTT0645T383

The string ALWAYS begins w/ quotes and is ALWAYS delimited with quotes. I need the first value within the quotes returned.

please give me some ideas, thanks
vindog26Asked:
Who is Participating?
 
PaulHewsConnect With a Mentor Commented:
You could use Split:

Dim strSplit() As String
strSplit = Split(strTest, """")
MsgBox strSplit(1)

You could also use Mid$ and Instr as follows:

MsgBox Mid$(strTest, 2, InStr(2, strTest, """") - 2)
0
 
DatabaseMX (Joe Anderson - Microsoft Access MVP)Database ArchitectCommented:
Left(YourString, Instr(1,YourString,Chr(34))-1)

try that ...

mx
0
 
Rey Obrero (Capricorn1)Commented:
where is this substring coming from?

0
Keep up with what's happening at Experts Exchange!

Sign up to receive Decoded, a new monthly digest with product updates, feature release info, continuing education opportunities, and more.

 
jkrCommented:
You could just

#include <string>
using namespace std;

int pos1,pos2;

string str = // your string

pos1 = str.find('\"');
pos1 = str.find('\"', pos1 + 1);

string result = str.substr(pos1 + 1, pos 2 - pos1 - 1);
0
 
Infinity08Commented:
Access
C++
Visual Basic

Which one is it ?
0
 
vindog26Author Commented:
I actually had to go w/ this.
Mid$([val], 1, InStr(2, [val], """") - 1)
 but close enough, thankx!
0
Question has a verified solution.

Are you are experiencing a similar issue? Get a personalized answer when you ask a related question.

Have a better answer? Share it in a comment.

All Courses

From novice to tech pro — start learning today.