I have a text file,which I use to input information into my application.The problem is that some values are float and sometimes they are null,which is why I get an exception.
var s = "0.0";
var f = float.Parse(s);
The code above throws an exception at line 2 "Input string was not in a correct format."
I believe the solution would be the advanced overloads of float.Parse,which include IFormatProvider as a parameter,but I don't know anything about it yet.
How do I parse "0.0"?
See Question&Answers more detail:
os 与恶龙缠斗过久,自身亦成为恶龙;凝视深渊过久,深渊将回以凝视…