日期:2014-05-18  浏览次数:21030 次

无法将类型char隐式转换为string
string strtemp,content;
content="GPRS#0#16fefeggggge";
strtemp=content[5];

如何实现转换呢???

------解决方案--------------------
strtemp = content[5].ToString();
你要获取什么?
------解决方案--------------------
char是一个字符,string是多个字符
1个怎么转换成多个字符呢
------解决方案--------------------
在后面加个""不就是字符串了么 ?
? string strtemp, content;
? content = "GPRS#0#16fefeggggge";
? strtemp = content[5]+"";
------解决方案--------------------
strtemp = content[5].ToString();
------解决方案--------------------
直接ToString()不行吗?