.net 如何把字符串类型转换为int类型

如题所述

第1个回答  2011-12-21
string str="0";
int num=Convert.ToInt32(str);//确保str是一个数字型的字符串,否则会报错本回答被提问者采纳
相似回答