Integer.TryParse - a better way?

后端 未结 7 1609
礼貌的吻别
礼貌的吻别 2020-12-08 06:51

I find myself often needing to use Integer.TryParse to test if a value is an integer. However, when you use TryParse, you have to pass a reference variable to the function,

7条回答
  •  借酒劲吻你
    2020-12-08 07:48

    Since you are using VB.net you can use the IsNumeric Function

    If IsNumeric(myInt) Then
        'Do Suff here
    End If
    

提交回复
热议问题