string s = "+OK 1 2729">>>>
> Dim test As String > Dim result As Integer > > test = "+OK 1 2729" > > If Integer.TryParse(test.Substring(4, 1), result) = True Then > 'result now contains the integer > MsgBox(result.ToString) > Else > 'value could not be converted > End If >Here it is in C# (same assumptions as Mike)
string s = "+OK 1 2729"; int i; if (int.TryParse(s.Substring(4,1)) { MessageBox.Show(string.Format("i:{0}",i)); } else { // value could not be converted }