Is there a way to limit free-text when using Console.ReadLine(); to prevent the use of special characters such as / , % ,$ , #. Currently I allow all characters and then use a .Replace("[special character","") to get rid of any.
Here is an example of my code
Console.ForegroundColor = ConsoleColor.Yellow;
Console.WriteLine("Please type-in the " + reqVariables[h] + " of the model below:");
Console.ForegroundColor = ConsoleColor.Magenta;
freeTextSerialNumbers = Console.ReadLine();
You could use
Console.ReadKey(true)in a loop and choose to eliminate those characters from the console while echoing othersSomething like this