我有以下示例数据:
21/10/2012 blahblah blah blahblah 265 blah 25 22/10/2012 blahblah blah blahblah 10 blah 14 blah 66 NK blahblah blah blahblah 25
我希望输出为以下数据:
21/10/2012 blahblah blah blahblah 265 blah 25
22/10/2012 blahblah blah blahblah 10 blah 14 blah 66 NK blahblah blah blahblah 25
我尝试了以下方法:
var regex = new Regex ("(\d{1,2})/(\d{1,2})/(\d{4})");
var matches = regex.Matches(str);//str is given above
foreach(var item in matches)
{
//my logic to do operations
}
这给出了日期数组。如何在日期上拆分字符串?