Imports System
Public Class ExtractFloatsFromString_VB
Public Shared Sub Main(ByVal args As String())
Dim str As String = "2.809 -36.91 21.487 -493.808 5034.7001"
Dim floats As Single() = New Single(4) {}
Dim tokens = str.Split(" "c)
Dim i As Integer = 0
For Each token In tokens
Dim f As Single = Single.Parse(token)
Console.WriteLine(f)
floats(Math.Min(System.Threading.Interlocked.Increment(i), i - 1)) = f
Next
End Sub
End Class
' run:
'
' 2.809
' -36.91
' 21.487
' -493.808
' 5034.7
'