加入收藏 | 设为首页 | 会员中心 | 我要投稿 李大同 (https://www.lidatong.com.cn/)- 科技、建站、经验、云计算、5G、大数据,站长网!
当前位置: 首页 > 百科 > 正文

c# – 无法从’System.Collections.Generic.IEnumerable’转换为

发布时间:2020-12-15 19:26:33 所属栏目:百科 来源:网络整理
导读:我试图反转我的字符串,但我得到跟随错误 string str = word.Reverse(); 错误: cannot convert from ‘System.Collections.Generic.IEnumerable’ to ‘string’ 有谁知道我该怎么办? 解决方法 您应该将字符连接在一起以创建新字符串. string str = string.
我试图反转我的字符串,但我得到跟随错误

string str = word.Reverse();

错误:

cannot convert from ‘System.Collections.Generic.IEnumerable’ to
‘string’

有谁知道我该怎么办?

解决方法

您应该将字符连接在一起以创建新字符串.

string str = string.Join(string.Empty,word.Reverse());

(编辑:李大同)

【声明】本站内容均来自网络,其相关言论仅代表作者个人观点,不代表本站立场。若无意侵犯到您的权利,请及时与联系站长删除相关内容!

    推荐文章
      热点阅读