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 >>>
>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 >} >Einar, don't you need to pass i into the TryParse method?