How do I prevent the code below from throwing a FormatException. I\'d like to be able to parse strings with a leading zero into ints. Is there a clean way to do
FormatException
Try
int i = Convert.ToInt32(value);
Edit: Hmm. As pointed out, it's just wrapping Int32.Parse. Not sure why you're getting the FormatException, regardless.