Tek-Tips is the largest IT community on the Internet today!

Members share and learn making Tek-Tips Forums the best source of peer-reviewed technical information on the Internet!

  • Congratulations Mike Lewis on being selected by the Tek-Tips community for having the most helpful posts in the forums last week. Way to Go!

Stripping a string 2 get value within brackets?? 1

Status
Not open for further replies.

ftpdoo

Programmer
Aug 9, 2001
202
GB
Hi,

I've got a string which contains contains a persons Chistian name and then their Surname in brackets.

ie: Joe (Bloggs)

How would I extract the surname within the backets just to return "Bloggs"??

Thankx,
Jonathan
 
MyName = "Joe (Bloggs)"
Lbracket = INStr(MyName, "(")
Rbracket = INStr(MyName, ")")
SurName = Mid(MyName, LBracket + 1, Rbracket - Lbracket - 1)
? SurName
Bloggs
MichaelRed
m.red@att.net

There is never time to do it right but there is always time to do it over
 
Status
Not open for further replies.

Part and Inventory Search

Sponsor

Back
Top