Integer.TryParse - a better way?

后端 未结 7 1581
礼貌的吻别
礼貌的吻别 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:53

    A variation would be:

    Int32.TryParse(input_string, Globalization.NumberStyles.Integer)
    
    0 讨论(0)
提交回复
热议问题