New to C#, but I love it! I used to use java and still do sometimes, but C# in Visual Studio is amazing.
Now the business...
I want to create a console application that prints messages to the console whenever the user inputs a sentence containing either a T, a t(lower case) or a question mark (?)
I have tried the below, but I have not been successful. It must look like kindergarten scrawl to some of you.
Someone please help me. I thank you in advance!
class Program
{
static void Main(string[] args)
{
Console.WriteLine("Type a sentence without using the letter T or a question mark.");
Console.ReadLine();
string userValue;
userValue = Console.ReadLine();
if(userValue.Contains("T"))
{
Console.WriteLine("Invalid");
}
else if(userValue.Contains("t"))
{
Console.WriteLine("Invalid");
Console.ReadLine();
}
else if (userValue.Contains("?"));
{
Console.WriteLine("Invalid");
Console.ReadLine();