using System;
public class ExtractFloatsFromString_CSharp {
public static void Main(string[] args) {
string str = "2.809 -36.91 21.487 -493.808 5034.7001";
float[] floats = new float[5];
var tokens = str.Split(' ');
int i = 0;
foreach (var token in tokens) {
float f = float.Parse(token);
Console.WriteLine(f);
floats[i++] = f;
}
}
}
/*
run:
2.809
-36.91
21.487
-493.808
5034.7
*/