By using this site, you agree to our updated Privacy Policy and our Terms of Use. Manage your Cookies Settings.
454,699 Members | 1,333 Online
Bytes IT Community
+ Ask a Question
Need help? Post your question and get tips & solutions from a community of 454,699 IT Pros & Developers. It's quick & easy.

newbi question on character validation

P: n/a
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

Feb 11 '06 #1
Share this Question
Share on Google+
2 Replies


P: n/a
Check out the string method .indexof or .contains
--
Dennis in Houston
"jo*******@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

Feb 11 '06 #2

P: n/a

<jo*******@gmail.com> wrote in message
news:11*********************@g44g2000cwa.googlegro ups.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.
Feb 11 '06 #3

This discussion thread is closed

Replies have been disabled for this discussion.