Tek-Tips is the largest IT community on the Internet today!

Members share and learn making Tek-Tips Forums the best source of peer-reviewed technical information on the Internet!

  • Congratulations Mike Lewis on being selected by the Tek-Tips community for having the most helpful posts in the forums last week. Way to Go!

I know this is an easy one but I wa

Status
Not open for further replies.

simoncpage

Programmer
Apr 4, 2002
256
GB
I know this is an easy one but I want to check a string if it contains a certain symbol "_" ???

 
Probably an easier way but:

For i = 1 to len(myString)
vs = mid(myString,i,1)
if vs = "_" then
-----do stuff
else
-----do other stuff
end if
HTH
Geoff
 
if instr(1, StringToCheck, "_") then
msgbox "your string contains '_'"
else
msgbox "you string does not contain '_'"
endif
 
Thanks istr is the function that I just couldnt rememeber cheers!
 
Status
Not open for further replies.

Part and Inventory Search

Sponsor

Back
Top