String Comparision

S

Stephen

Hi,

Whats the best way to compare string?
I have a text box, the text of which should not contain "P.O. Box" or "Box"
or "PO Box"

Stephen.
 
D

darrel

Whats the best way to compare string?
I have a text box, the text of which should not contain "P.O. Box" or "Box"
or "PO Box"

You could use regular expresions.

Otherwise, if you're fairly confident those are the most likely/only
combinations, then you can just use instr:

if (instr(yourString, "P.O.") > 0) or (instr(yourString, "PO ") > 0) or
(instr(yourString, "Box") > 0) then...

-Darrel
 
G

Guest

Maybe create a checkbox they can select if they have a PO Box and if checked
allow them to put a number in there. Or you can do an txtBox.IndexOf("Box")
= 0 but you might have problems if they live on John Box Street.
 
K

Kevin Spencer

Whats the best way to compare string?

Hemp is biodegradeable, but nylon is much stronger.

--
;-),
Kevin Spencer
..Net Developer
Microsoft MVP
I get paid good money to
solve puzzles for a living
 
K

Kevin Spencer

Hi Stephen,

Sorry about the little joke. I was feeling mischievous.

After re-reading your question, as well as the answers you've already
received, I'm thinking that it might help to suggest that, rather than
defining what should NOT be in the text box, what exactly SHOULD be in the
text box? That would be a better way to approach the question.

--
HTH,
Kevin Spencer
..Net Developer
Microsoft MVP
I get paid good money to
solve puzzles for a living
 

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

Members online

No members online now.

Forum statistics

Threads
473,733
Messages
2,569,440
Members
44,832
Latest member
GlennSmall

Latest Threads

Top