怎么截串~~急~有例子 假如字符串2008-11-1 8:42:002008-11-23 16:42:00怎么才能取空格以后的所有位数呀~所要的结果是8:42:0016:42:00 解决方案 » 免费领取超大流量手机卡,每月29元包185G流量+100分钟通话, 中国电信官方发货 string str = @"2008-11-1 8:42:00"; int indexlen = str.IndexOf(" ", 1); int leng = str.Length - indexlen; string newstr = str.Substring(indexlen,leng); string str = @"2008-11-1 8:42:00"; int indexlen = str.IndexOf(" ", 1); int leng = str.Length - indexlen; string newstr = str.Substring(indexlen,leng); string str = "2008-11-1 8:42:00";Console.WriteLine(str.Substring(str.IndexOf(" "),str.Length - str.IndexOf(" ")));Console.ReadKey(); string s = "2008-11-23 16:42:00"; string s1 = s.Substring(12, s.Length - 12); Console.Write(s1); 用string.splite 方法,把字符串按 分隔符生成数组,然后取数组的内容 string Temp = "2008-11-1 8:42:00"; Temp = Temp.Remove(0, Temp.IndexOf(' ')).Trim(); string time = @"2008-11-1 8:42:00".Splite(' ')[1]; 正则Regex.Match("2008-11-1 8:42:00",@"(?<=\s)\d{1,2}:\d{1,2}:\d{1,2}").Value 假如只是要取时间的小时:分钟:秒的话这里也可以实现 string time = "2008-11-1 8:42:00"; DateTime dt = Convert.ToDateTime(time); time = dt.ToString("hh:mm:ss");如果本来就是DateTime就是不需要转换了 怎么让winform 程序报错时不弹出异常提示框 懂VB、C++、C#的来帮我解决个问题 oracle 中tble明明存在 却报错“表或视图不存在” 关于Web.config的配置问题 有没有C#的MRP或者CRM的比较好一点的2005的源码啊?怎么这么难找啊!!! POS for .Net 怎麽用啊? 无法引用System.Windows的原因? JavaScript资源 Type.GetMethod方法遇到重载的怎么办?有没有查出是否有重载的方法? 哪有c# 安裝下載 如何反射被混淆的代码? 父类调用,如果实现?
int indexlen = str.IndexOf(" ", 1);
int leng = str.Length - indexlen; string newstr = str.Substring(indexlen,leng);
int indexlen = str.IndexOf(" ", 1);
int leng = str.Length - indexlen; string newstr = str.Substring(indexlen,leng);
Console.WriteLine(str.Substring(str.IndexOf(" "),str.Length - str.IndexOf(" ")));
Console.ReadKey();
string s1 = s.Substring(12, s.Length - 12);
Console.Write(s1);
Temp = Temp.Remove(0, Temp.IndexOf(' ')).Trim();
Regex.Match("2008-11-1 8:42:00",@"(?<=\s)\d{1,2}:\d{1,2}:\d{1,2}").Value
小时:分钟:秒
的话这里也可以实现 string time = "2008-11-1 8:42:00";
DateTime dt = Convert.ToDateTime(time);
time = dt.ToString("hh:mm:ss");如果本来就是DateTime就是不需要转换了