|
-
Dec 3rd, 2003, 07:36 PM
#1
Thread Starter
Lively Member
split question
I have a string that looks like this:
Company|Address|City State Zip|other info
I need to split the City State and Zip into seperate fields using "|"
The state is always 2 letters
City is not always one word
How can I do this?
Thanks
-
Dec 3rd, 2003, 09:29 PM
#2
PowerPoster
Code:
Dim strMyString as String
Dim strSplitString() as String
strMyString = "Company|Address|City State Zip|other info"
strSplitString = strMyString.Split("|")
'strSplitString now contains an array of strings that were split.
-
Dec 5th, 2003, 09:11 PM
#3
Thread Starter
Lively Member
Not what I am looking for
What I need is to split the City , state and Zip into seperate fields. Like so
|City|State|Zip|
-
Dec 12th, 2003, 04:33 PM
#4
Hellswraith's example
You can still use Hellwraith's example.
If you use his split example you know that strSplitString(2)=City State Zip
If the state is allways 2 letters and I'm guessing that the zipcode is also allways the same
length (unless the info is from different countries), you should be able to pick those out, and
whatever is left must be the city.
I wish I could think of something witty to put in my sig...
...Currently using VS2013...
-
Dec 12th, 2003, 08:51 PM
#5
Frenzied Member
VB Code:
strAddress = strSplit(strSplitString(2)) 'default is space
strCity = strAddress(0)
strState = strAddress(1)
strZip = strAddress(2)
Posting Permissions
- You may not post new threads
- You may not post replies
- You may not post attachments
- You may not edit your posts
-
Forum Rules
|
Click Here to Expand Forum to Full Width
|