|
-
Feb 12th, 2000, 03:55 AM
#1
Thread Starter
Hyperactive Member
I want to be able to separate a string into two further strings - probably easiest by finding the first 'space' in the string.
Eg. the string contains a website and a description. I need to be able to split them into two strings:
http://www.yahoo.co.uk UK version of this popular search engine http://www.bbc.co.uk The BBC's own Internet home page http://www.knowsley.gov.uk Knowsley MBC's home on the 'Net
Hope someone can help 
Simon
-
Feb 12th, 2000, 04:20 AM
#2
Hyperactive Member
Use the InStr function to determine the location of the space. InStr finds the first occurence of a specified character in a string.
Private Sub Command1_Click()
Dim String1, String2, String3 As String
String1 = "http://www.yahoo.co.uk UK version of this popular search engine"
String2 = _
Left(String1, InStr(String1, " "))
String3 = _
Right(String1, Len(String1) - InStr(String1, " "))
End Sub
------------------
Andrew Nerney
Hapless Programmer
[email protected]
-
Feb 12th, 2000, 04:20 AM
#3
-
Feb 12th, 2000, 05:00 AM
#4
Thread Starter
Hyperactive Member
-
Feb 12th, 2000, 05:44 AM
#5
Hyperactive Member
No hay problema, simonp! And ChrisC - looks like great minds think alike. Same function and posted the exact same minute! LOL!
------------------
Andrew Nerney
Hapless Programmer
[email protected]
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
|