character selection in a string by:Anonymous
|
I have the following type of data sitting in a varaible:
Just Buttons+button
The text and lenght can change, however, no matter what the length is I would like to strip off the "+" sign and everything to the right of it and place it into another (or the same) variable. What is the easiest way to accomplish this?
Thank you, John
|
| | Reply: by:Armin Zingler
|
| | Dim s As String
s = "Just Buttons+button"
s = s.Split("+"c)(0) -- Armin
How to quote and why: http://www.plig.net/nnq/nquote.html http://www.netmeister.org/news/learn2quote.html
|
| | Reply: by:Jay B. Harlow [MVP - Outlook]
|
| | John, In addition to Armin's suggestion:
Dim s As String
s = "Just Buttons+button"
s = s.SubString(0, s.IndexOf("+"c)
I suspect there are probably 2 or 3 other methods you could use ;-)
Hope this helps Jay
|
| | Reply: by:Cor Ligthert
|
| | HI Jay,
> I suspect there are probably 2 or 3 other methods you could use ;-)
It was for me a challenge and I can give of course a VB left function, however the one you gave is the best in my opinion and therefore I will not bring the OP in problems by giving him another one.
:-)
No need answering.
Cor
|
0 Comments:
Post a Comment
<< Home