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]);
[解决办法]