I have a lot of querystrings and form input as strings that I need to convert to integer values Convert.ToInt32(strValue) but that obviously goes wrong if there's anything but the characters 0123456789 in the string. So how can I check if it is possible to do the conversion before I do it and possibly fail?
I have learned that exception handling (try-cases) are not very good for performance and should be avoided but that is the only solution I can think of. Right now I'm using this:
1 public static bool IsInt32(string value)
2 {
3 try
4 {
5 int number = Convert.ToInt32(value Go to the complete details ...