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

这个能用Linq改下么?现阶段研究Linq to object

2011-12-07 
这个能用Linq改下么?目前研究Linq to objectC# codestring date 2011年6月3日 14:01Regex regex ne

这个能用Linq改下么?目前研究Linq to object

C# code
            string date = "2011年6月3日 14:01";            Regex regex = new Regex(@"(\d+)年(\d+)月(\d+)日 (\d+):(\d+)");            Match m= regex.Match(date);            string[] arrstr ={ m.Groups[1].Value, m.Groups[2].Value, m.Groups[3].Value,m.Groups[4].Value,m.Groups[5].Value };//这里可以用Linq么 skip1take5???            string format = "{0}-{1}-{2} {3}:{4}";            string result = string.Format(format, arrstr);            Console.WriteLine(result);            Console.ReadLine();


[解决办法]
探讨

必须实现 必须实现Ienumerable<t>?

热点排行