|
-
July 1st, 2001, 03:50 PM
#1
Strings
How do you search a string for the vbCrLf
character and then separate the string into
two strings without the vbCrLf character?
-
July 1st, 2001, 04:13 PM
#2
Re: Strings
try this code:
Dim tmp as string
Dim s1 as string, s2 as string
tmp = "First string" & vbCrLf & "Second string"
s1 = mid$(tmp, 1, InStr(1, tmp, vbCrLf) - 1)
s2 = mid$(tmp, InStr(1, tmp, vbCrLf) + 2,
len(tmp)) 'vbCrLf is 2 chars, that's why + 2
----------
The @host is everywhere!
----------
-
July 1st, 2001, 04:45 PM
#3
Re: Strings
Try using the split function.
Modify to suit your needs
Dim tmp As String
Dim s1() As String
tmp = "First string" & vbCrLf & "Second string"
s1 = Split(tmp, vbCrLf)
Text1 = s1(0)
Text2 = s1(1)
David Paulson
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
|