|
web
newsgroups
|
|||||||||||||||||||||||
|
|||||||||||||||||||||||
newbi question on character validationThis 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 Check out the string method .indexof or .contains
-- Show quoteHide quoteDennis in Houston "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 > > <joe.mi***@gmail.com> wrote in message
news:1139618897.960048.69680@g44g2000cwa.googlegroups.com... Since you are defining "best" as being the "simplest", I'd say try the Instr: 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 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. |
|||||||||||||||||||||||