I'm new in C# and need to read float
values (x, y, z)
from file.
It looks like:
0 -0.01 -0.002
0.000833333333333 -0.01 -0.002
If Iam trying
float number = float.Parse("0,54"); // it works well, but
float number = float.Parse("0.54"); // gains exepction.
My code for reading values from each line (could be bugged):
int begin = 0;
int end = 0;
for (int i = 0; i < tempLine.Length; i++)
{
if (Char.IsWhiteSpace(tempLine.ElementAt(i)))
{
end = i;
float value = float.Parse(tempLine.Substring(begin, end));
begin = end;
System.Console.WriteLine(value);
}
}
Someone could help?
float.Parse
etc – Spectrometer