Link to home
Start Free TrialLog in
Avatar of pjroy
pjroy

asked on

Find a subset in a string

Ex.: I have this string "id1##id2##id3". The ## are the delimiter in this string. I want to obtain the first part of this string, so all the caracter before the #. Is there any function in VB to do that?
ASKER CERTIFIED SOLUTION
Avatar of traygreen
traygreen

Link to home
membership
This solution is only available to members.
To access this solution, you must be a member of Experts Exchange.
Start Free Trial
Avatar of dabellei
dabellei

text = "id1##id2##id3"
id1 = mid$(text,1,instr(text,"#") - 1)
this will give you id1 for id2

"create a new value for text
text = mid$(text,1,instr(text,"#") + 2)
id2 = mid$(text,1,instr(text,"#") - 1)

Yep, sorry I forgot the -1