hello

can any one please write code in simple language tht how to find vowel from string

Thanks

Recommended Answers

All 4 Replies

lookin dat dar string
    izzit dat vowuel?
        yup, stop lookin'
        nope, keepa goin'

didja find it?
    yup, hola!
    nope, hola louda!

See below.

lookin dat dar string
    izzit dat vowuel?
        yup, stop lookin'
        nope, keepa goin'

didja find it?
    yup, hola!
    nope, hola louda!

LMAO, I love it. It's humorous and it gives the correct answer to the question.

To add some more insight into the answer I would put the vowels into a container like an array or vector. Then just loop through it one letter at a time. Tom's algorithm is correct, just translate it into C/C++.

for (int i = 0; i < mystring.length(); i++)
{
   for (int j = 0; j < myArrayLength; j++)
   {
         if (mystring[i] == myArray[j])
         {
             //it's a vowel
          }
    }
}

This should help :

string messageToYou(" try it out first");
string vowels("aeiouyw"); //whatever you think should be considered a vowel

size_t upTo = vowels.size();

for int i = 0 to UpTo, increment i
{
    if(message.find(vowels[i] != string::npos)
        //do something
  else //do something
}
Be a part of the DaniWeb community

We're a friendly, industry-focused community of developers, IT pros, digital marketers, and technology enthusiasts meeting, networking, learning, and sharing knowledge.