'Fast
Sub getInt(str As String) As Int
Dim s = 0, v = 0, p = 1, i = str.Length - 1 As Int
Do While i > -1
v = Asc(str.CharAt(i))
If v = 45 Then
s = -s
Exit
End If
s = s + ((v - 48) * p)
p = p * 10
i = i - 1
Loop
Return s
End Sub
'Even faster
Sub getUnsignedInt(str As String) As Int
Dim s = 0, p = 1, i = str.Length - 1 As Int
Do While i > -1
s = s + ((Asc(str.CharAt(i)) - 48) * p)
p = p * 10
i = i - 1
Loop
Return s
End Sub