How do I convert from a string to an integer in Visual Basic?

后端 未结 7 1055
死守一世寂寞
死守一世寂寞 2020-12-15 15:06

How do I convert from a string to an integer? Here\'s what I tried:

Price = CInt(Int(txtPrice.Text))

I took out the Int and I

相关标签:
7条回答
  • 2020-12-15 15:46

    You can use the following to convert string to int:

    • CInt(String) for ints
    • CDec(String) for decimals

    For details refer to Type Conversion Functions (Visual Basic).

    0 讨论(0)
提交回复
热议问题