Good day everyone.
There is an XML file in which you need to parse double
values. Please tell me how you can parse through double.Parse()
. Here is the piece itself:
<Width>245.50</Width> <IntersectionPlane> <X>0.000</X> <Y>0.000</Y> <Z>1.000</Z> </IntersectionPlane> <IntersectionPlane> <X>0.000</X> <Y>-300.000</Y> <Z>-0.000</Z> </IntersectionPlane> <IntersectionPlane> <X>-0.000</X> <Y>-0.000</Y> <Z>300.000</Z> </IntersectionPlane>
File serialization was done via XmlSerializer
respectively, reading via Deserialize
. I tried to parse values through string.Split()
, it does not work. Tell me how it could be implemented. I wish there was something like this:
round.Width = double.Parse(tokens[0]); plane.PlaneIntersection = new Point3D(ParseDouble(tokens[0]), ParseDouble(tokens[1]), ParseDouble(tokens[2]));
ParseDouble(string digit):
method code ParseDouble(string digit):
private double ParseDouble(string digit) { double res; double.TryParse(digit, style, culture, out res); return res; }