标签:编译 隐式 code string int 隐式转换 对象 str ring
并非每个对象都可以直接转换为int。例如,以下内容将无法编译:
string Maomao = "100";
int i = (int)Maomao;
因为string无法隐式转换为int。 如果必须要做就这样写:
string Maomao = "100";
int i = Convert.ToInt32(Maomao);
标签:编译 隐式 code string int 隐式转换 对象 str ring
原文地址:https://www.cnblogs.com/maomaodesu/p/11393355.html