|
-
May 14th, 2006, 08:16 PM
#1
Thread Starter
Addicted Member
Re: string manipulation help
 Originally Posted by RhinoBull
There are multiple ways of parsing so here one:
VB Code:
Private Sub Command1_Click()
Dim sText As String
Dim res1$, res2$
sText = "123456 - Popo"
res1 = Trim(Left(sText, InStr(1, sText, "-") - 1))
res2 = Trim(Mid(sText, InStr(1, sText, "-") + 1))
Debug.Print res1
Debug.Print res2
End Sub
i got an error in this with this example string "123456 - Popo-Cost"
result1 = "123456 - Popo"
result2 = "Cost"
the result must be
result1 = "123456"
result2 = "Popo-Cost"
cheers
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
|