给两个时间。比如2004-6 2007-9 怎么求出当中的年月啊如2004-7 2004-8 2004-9 等 然后把这些时间取出来。放在哪里好呢。怎么遍历啊 给两个时间。比如2004-6 2007-9 怎么求出当中的年月啊如2004-7 2004-8 2004-9 等 然后把这些时间取出来。放在哪里好呢。怎么遍历啊 解决方案 » 免费领取超大流量手机卡,每月29元包185G流量+100分钟通话, 中国电信官方发货 string str1 = "2004-7 2004-8 2004-9";string[] ary = str1.Split(' ');for(int i=0;i<ary.Length;i++){DateTime myd = DateTime.Parse(ary[i].ToString() + "-1");年月 = myd.ToString("yyyy-MM");} string str1 = "2004-7 2004-8 2004-9"; Regex regex = new Regex("\\d{4}-[0,1]?\\d{1}"); MatchCollection col = regex.Matches(str1); for(int i=0; i<col.Count; i++) { Response.Write(col[i].Value); } 登录人员问题·求解 想制作一个基于ASP.NET的大文件上传 关于数组ArrayList分解成SQL WORD加载XML扩展包 标准表达式中数据类型不匹配。 一个我搞不定的问题,希望高手来帮我解决下子! 哪里有asp.net权限管理的源码 高分求助:在asp.net中如何用FLASH控制摄象头 求DNN(DotNetNuke)的安装,能人请进. 请教一个关于asp.net mvc 路由的问题 IsStartupScriptRegistered,缺少对象?忙了我一上午了(在线等待) 如何在服务端控制td的属性
string[] ary = str1.Split(' ');
for(int i=0;i<ary.Length;i++)
{
DateTime myd = DateTime.Parse(ary[i].ToString() + "-1");
年月 = myd.ToString("yyyy-MM");
}
Regex regex = new Regex("\\d{4}-[0,1]?\\d{1}");
MatchCollection col = regex.Matches(str1);
for(int i=0; i<col.Count; i++)
{
Response.Write(col[i].Value);
}