How do I make c sharp ignore letter case
Here I have some simple C# code;
Console.WriteLine("Enter Name");
var name = Console.ReadLine();
if (name == "ashley")
{
Console.WriteLine("You entered: " + name);
}
Console.Read();`
If the user enters ashley it will display "You entered ashley". However if
the user enters Ashley or AsHlEy it won't work. What do I need to add to
this or how to format so it will ignore the case?
No comments:
Post a Comment