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 derfloh on being selected by the Tek-Tips community for having the most helpful posts in the forums last week. Way to Go!

check a viarable to see if it has a ' in it

Status
Not open for further replies.

HebieBug

Programmer
Jan 8, 2001
354
JP
Does anyone know of a way of checking to see if a variable contains a ' (apostrophe)?.
The user enters details into a text box and then it checks to see if the apostrophe is contained within that text box.
 
Use the Instr function. If it returns a value > 0 then the apostrophe exists

eg instr(1,"book","'",1) = 0
but instr(1,"boo'k","'",1) = 4 because it finds ' as the 4th char.


 
Status
Not open for further replies.

Part and Inventory Search

Sponsor

Back
Top