◆简单实例: strings="2005-...... 简单实例: string s = "2005-2-21"; Regex reg = new Regex(@"(? Match match = reg.Match(s); int year = int.Parse(match.Groups["y"].Value); int month = int.Parse(match.Groups["m"].Value); int day = int .Parse(match.Groups["d"].Value); DateTime time = new DateTime(year,month,day); |
|小黑屋|最新主题|手机版|微赢网络技术论坛 ( 苏ICP备08020429号 )
GMT+8, 2024-9-29 17:34 , Processed in 0.178267 second(s), 12 queries , Gzip On, MemCache On.
Powered by Discuz! X3.5
© 2001-2023 Discuz! Team.