不挂科搜题免费

问题:

将字符串string s=”9753”;转换为int类型,正确的语句是( )

选项

  • int n=int.Parse(s)

  • int n=int.ValueOf(s)

  • int n=Convert.ToDouble(s)

  • int n=Convert.ToInt32(s)

  • 答案:

    B.int n=int.ValueOf(s)