Try this:
char[] vowels = {'a','e','i','o','u'};
string input = txtInput.Text.ToLower();
char[] splittedResult = input.Split('');
int ctr = 0;
foreach(char result in splittedResult)
{
switch(result)
case vowels[0]:
case vowels[1]:
case vowels[2]:
case vowels[3]:
case vowels[4]: ctr++;
break;
default: break;
}
The result of
ctr
will be the count of vowels.
Please mark as answer and vote 5 if this solved your problem
Regards,
Eduard