Ok so this is my base pig latin code and I need it to detect and change the capital letters into lower case as well as move the end punctuation to the end of the pig latinized word. For example if I type "Hello!" it gives me "ello!Hay" when I want it to give me "Ellohay!". I have been trying to figure this out for a few days now.
namespace PigLatin
{
class Program
{
static void Main(string[] args)
{
string pigWord = "";
string sentence = "";
string firstLetter;
string restOfWord;
string vowels = "AEIOUaeiou";
string Cap = "QWERTYUIOPASDFGHJKLZXCVBNM";
string Punc = ".,/?><\";:][}{\\|=+-_)(*&^%$#@!]";
int letterPos;
while (sentence.ToLower() != "quit")
{
Console.WriteLine("Please enter a sentence (or type \"quit\" to exit)");
sentence = Console.ReadLine();
{
foreach (string word in sentence.Split())
{
firstLetter = word.Substring(0, 1);
restOfWord = word.Substring(1, word.Length - 1);
letterPos = vowels.IndexOf(firstLetter);
if (letterPos == -1)
{
pigWord = restOfWord + firstLetter + "ay";
}
else
{
pigWord = word + "way";
}
Console.Write("{0} ", pigWord);
}
}
}
}
}
}