newbi question on character validation

  • Thread starter Thread starter joe.minga
  • Start date Start date
J

joe.minga

This is an assignment for an VB intro class and I have no experience.
Any help would be appreciated.

I need to accept users name as input and then check for the existence
of a specific letter in the name. (the letter 'e') If it exists in
their name, reply one way, if not, reply another way. Question: whats
the best (simplest) way to check each character of the input and
compare it with the specific letter?

TIA,
-minga
 
: This is an assignment for an VB intro class and I have no experience.
: Any help would be appreciated.
:
: I need to accept users name as input and then check for the existence
: of a specific letter in the name. (the letter 'e') If it exists in
: their name, reply one way, if not, reply another way. Question: whats
: the best (simplest) way to check each character of the input and
: compare it with the specific letter?
:
: TIA,
: -minga


Since you are defining "best" as being the "simplest", I'd say try the Instr
function. If you need to check for the character independent of case (e.g.:
"e" or "E"), then also check out the LCase and UCase functions.


Ralf
 
Back
Top