आईएएम सी # में नया है और फ़ाइल से float
मूल्य (x, y, z)
पढ़ने की आवश्यकता है। ऐसा लगता है कि:सी # फ्लोट। पर्स स्ट्रिंग
0 -0,01 -0,002
0,000833333333333 -0,01 -0,002
Iam प्रत्येक पंक्ति से मूल्यों को पढ़ने के लिए कोशिश कर रहा है, तो
float number = float.Parse("0,54"); // it works well, but
float number = float.Parse("0.54"); // gains exepction.
मेरे कोड (बग किया जा सकता है):
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);
}
}
कोई मदद कर सकता है?
मैं 'float.Parse' आदि – geedubb