Count vowels in "Interview Prep".
Ready — edit the code above and click Run.
using System;
class Program
{
static void Main()
{
string s = "Interview Prep";
int count = 0;
foreach (char c in s.ToLower())
if ("aeiou".Contains(c)) count++;
Console.WriteLine(count);
}
}
Try solving on your own first, then reveal the official answer.
Normalize case with ToLower() before checking vowel set.