Quote:
Alert the user that other datatypes (eg string) was inserted without crashing
You have a misconception of how user input is done.
Console.ReadLine()
takes user input as a string and only a string.
int.Parse
convert the contains of a string and crashes the program if not happy with the string contains.
int.TryParse
tells you if the parse was successful instead of crashing.
If you want yo parse more complex data, you will have to learn Regular Expressions.
Here is a link to RegEx documentation:
perlre - perldoc.perl.org[
^]
Here is links to tools to help build RegEx and debug them:
.NET Regex Tester - Regex Storm[
^]
Expresso Regular Expression Tool[
^]
This one show you the RegEx as a nice graph which is really helpful to understand what is doing a RegEx:
Debuggex: Online visual regex tester. JavaScript, Python, and PCRE.[
^]