public static void Main(string[] args)
Console.WriteLine("pig latin is hard to code");
PigLatinConsole.WriteLine("pig latin is hard to code");
Console.WriteLine("pIg laTIn iS haEdEr TO cODE In MiXeD CAse");
PigLatinConsole.WriteLine("pIg laTIn iS haEdEr TO cODE In MiXeD CAse");
public static class PigLatinConsole
private const string consonants = "bcdfghjklmnpqrstvwxyz";
private const string vowels = "aeiou";
public static void WriteLine(string str)
foreach (var word in words)
var strLower = word.ToLower();
if (strLower.IndexOfAny(consonants.ToCharArray()) == 0)
var firstVowelIdx = strLower.IndexOfAny(vowels.ToCharArray());
strToPrint = word.Substring(firstVowelIdx, word.Length - firstVowelIdx);
strToPrint += word.Substring(0, firstVowelIdx);
Console.Write(strToPrint + "ay ");