#### Archived

This topic is now archived and is closed to further replies.

# Extracting a string with VB

This topic is 5775 days old which is more than the 365 day threshold we allow for new replies. Please post a new topic.

## Recommended Posts

im very rusty with VB...and im using VB3, not .NET this time..its something im working on for my brother...anyways, here is my problem. i have a random text string like this:
3(s''sdsdsd.s'''','''''', ''sds&wew'''''',22''SDdfd&dfdfd.ett''

i cant seem to figure out how to extract the text that has the ampersand(&) WITHIN the single quote...for example...the string that would be extracted from the previous example is: sds&wew and SDdfd&dfdfd.ett im going nuts! can anyone help?

##### Share on other sites
I don''t know if this will work in VB3 or not but you can give this a try.

Dim strValue As String
Dim colResults As Collection

strValue="3(s''sdsdsd.s'''','''''', ''sds&wew'''''',22''SDdfd&dfdfd.ett''"

aryValues = Split(strValue,"''")

For i=0 to UBOUND(aryValues)
if InStr(aryValues(i),"&")=0 then
end if
Next

You then have the values that contain an "&" in the collection and can do with it what you need.