How to convert string to integer in C#

前端 未结 12 1666
我在风中等你
我在风中等你 2020-11-28 08:17

How do I convert a string to an integer in C#?

12条回答
  •  醉酒成梦
    2020-11-28 08:58

    You can use either,

        int i = Convert.ToInt32(myString);
    

    or

        int i =int.Parse(myString);
    

提交回复
热议问题