I am working on a program that is designed to count the vowels in a word, however I am having trouble counting the vowels per word. My current code looks like this:
string word;
string[] ca = { "a", "e", "i", "o", "u", "A", "E", "I", "O", "U" };
int va = 0;
public Form1()
{
InitializeComponent();
}
private void button1_Click(object sender, EventArgs e)
{
if (ca.Contains(word))
{
label1.Text = "Vowel Count: " + va;
}
else
{
label1.Text = "Vowel Count: " + va;
}
}
Thanks for the help!