Searching for a unique charater in a string, vb

  • Thread starter Thread starter Azazal
  • Start date Start date
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
 
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
 
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)
 

Ask a Question

Want to reply to this thread or ask your own question?

You'll need to choose a username for the site, which only take a couple of moments. After that, you can post your question and our members will help you out.

Ask a Question

Back
Top