ray14
asked on
what is the function which can ...
Hi,
if S = "Ray 14" , are there any VB function makes me, by using it, let SS = "Ray"
notes: i cannot use (Left) function because S could be more than 3 letters
ex:
Dim S as string, SS as string
S = "Ray 14"
SS = something(S)
by runinng this code : SS = "Ray"
I look forward your code and help.
Thanks
Ray14
if S = "Ray 14" , are there any VB function makes me, by using it, let SS = "Ray"
notes: i cannot use (Left) function because S could be more than 3 letters
ex:
Dim S as string, SS as string
S = "Ray 14"
SS = something(S)
by runinng this code : SS = "Ray"
I look forward your code and help.
Thanks
Ray14
if your using vb6 you could use the split function
Dim S As String
Dim SS() As String
S = "Ray 14"
SS = Split(S, " ")
MsgBox SS(0)
Dim S As String
Dim SS() As String
S = "Ray 14"
SS = Split(S, " ")
MsgBox SS(0)
I would've used Split, but the asker said he wanted SS="Ray". 6 of one, half a dozen of the other.
Cheers,
RichW
Cheers,
RichW
ASKER CERTIFIED SOLUTION
membership
This solution is only available to members.
To access this solution, you must be a member of Experts Exchange.
S = "Ray 14"
i = InStr(1, S, " ")
SS = Mid(S, 1, i - 1)