Convert String to Int in C# - Cambia Research
Using TryParse with Nullable Integer When the above example fails to parse the string as a valid integer, you can see that we just set it to -1. This doesn't work too well if -1 one is a meaningful value in your program. Instead, we could parse the string...