Home All Groups Group Topic Archive Search About

newbi question on character validation

Author
11 Feb 2006 12:48 AM
joe.minga@gmail.com
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

Author
11 Feb 2006 1:22 AM
Dennis
Check out the string method .indexof or .contains
--
Dennis in Houston


Show quoteHide quote
"joe.mi***@gmail.com" wrote:

> 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
>
>
Author
11 Feb 2006 2:58 AM
_AnonCoward
<joe.mi***@gmail.com> wrote in message
news:1139618897.960048.69680@g44g2000cwa.googlegroups.com...
: 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
--
--
----------------------------------------------------------
*             ^~^                   ^~^                  *
*          _ {~ ~}                 {~ ~} _               *
*         /_``>*<                   >*<''_\              *
*        (\--_)++)                 (++(_--/)             *
----------------------------------------------------------
There are no advanced students in Aikido - there are only
competent beginners. There are no advanced techniques -
only the correct application of basic principles.