首页 诗词 字典 板报 句子 名言 友答 励志 学校 网站地图
当前位置: 首页 > 教程频道 > .NET > C# >

using System.Linq;这是什么,该怎么处理

2012-03-22 
using System.Linq这是什么别人的是using Systemusing System.Collections.Genericusing System.Linqu

using System.Linq;这是什么
别人的是
using System;
using System.Collections.Generic;
using System.Linq;
using System.Text;这样的
我默认的是
using System;
using System.Collections.Generic;
using System.Text;
结果我的
void Main()
{
   
string str="1234";
Console.WriteLine(new string(str.ToCharArray().Reverse().ToArray()));
//4321  
}

这段代码产生了Reverse方法没有采用“0”个参数的重载
这个错误 这是为什么
我的string类本身就不支持reverse操作吗?

[解决办法]
你建的项目是.NET FRAMEWORK2.0的
你建一个.NET FRAMEWORK3.5的项目 就知道了
[解决办法]
.Net Framework 3.5里的扩展方法。

热点排行