Searching for a unique charater in a string, vb

A

Azazal

hello,

Does anyone know how to search for a unique charater in a string. For
example,

Dim vcsel_name as string

' vcsel_name is a variable and changes as I compile my data, I need to
separate the data according to the last two characters of the string.
Therefor I need something like

if vcsel_name.find = "VO" then

(body of code)

end if

obviously I made up the .find function, but can anyone tell me the
proper function I could use to accomplish this task.

Thanks
 
J

Juan Pablo González

hello,
Does anyone know how to search for a unique charater in a string. For
example,

Dim vcsel_name as string

' vcsel_name is a variable and changes as I compile my data, I need to
separate the data according to the last two characters of the string.
Therefor I need something like

if vcsel_name.find = "VO" then

(body of code)

end if

obviously I made up the .find function, but can anyone tell me the
proper function I could use to accomplish this task.

Thanks

You could use

If InStr(1, vcsel_name, "VO", 1) > 0 Then

or

If Right$(, vcsel_name, 2) = "VO" Then
 
B

Bob Phillips

Use Instr. like

If Instr(vcsel_name, "VO") > 0 Then
' it is in there
Else
'it is not
End If

--

HTH

Bob Phillips
... looking out across Poole Harbour to the Purbecks
(remove nothere from the email address if mailing direct)
 
Top