string类型转化为float解决方法
string类型转化为float
http://topic.****.net/u/20120524/22/fcb72f85-7d36-49f2-b07d-fe6b816f1f57.html?70560
------解决方案--------------------
http://topic.****.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]);
------解决方案--------------------