日期:2014-05-18  浏览次数:20818 次

string类型转化为float
http://topic.csdn.net/u/20120524/22/fcb72f85-7d36-49f2-b07d-fe6b816f1f57.html?70560

------解决方案--------------------
C# code
        string s = File.ReadAllText(@"c:\test.txt");
        string[] values = s.Split(new char[] { ' ' }, StringSplitOptions.RemoveEmptyEntries);
        float[] rs = new float[values.Length];
        for (int i = 0; i < rs.Length; i++)
            rs[i] = float.Parse(values[i]);

------解决方案--------------------
探讨
C# code

string s = File.ReadAllText(@"c:\test.txt");
string[] values = s.Split(new char[] { ' ' }, StringSplitOptions.RemoveEmptyEntries);
float[] rs = new float[values.Le……