string tmp = "Monday; 12/11/2013 | 0.23.59
我如何获得日期字符串,即12/11/2013。我试试这个:如何从此获取日期字符串?
int sep=tmp.IndexOf(";");
int lat=tmp.IndexOf("|");
string thu = tmp.Substring(0, sep);
string tem = tmp.Substring(lat + 1);
string ngay = tmp.Substring(sep, tmp.Length - (sep+tem.Length);
Console.WriteLine("Date: {0}", ngay);
这怎么可以在C#中完成?
谢谢,但错误\t为“串的最佳重载的方法匹配。拆分(char [],System.StringSplitOptions)'有一些无效的参数 –
尝试它现在写的方式。我从内存中工作,并经常得到不正确的参数。它现在已经过测试和工作。 – Yuck