Use regular expressions

 void ShowVowels(string input)
 {
      string str = "(a|e|i|o|u)";
      Regex expression = new Regex(str);
      if (expression.IsMatch(input))
      {
          MatchCollection value = expression.Matches(input);
          foreach (Match m in value)
          {
              Console.WriteLine(m.Value);
          }
            }
 }

Lav
http://lavbox.blogspot.com

Reply via email to