假设我有以下字符串之一:
"Hello, I'm a String... This is a Stackoverflowquestion!! Here is a Date: 16.03.2013, 02:35 and yeah, plain text blah blah..-."
"This the other string! :) 22.11.2012. Its a Date you see"
"Here we have 2 Dates, 23.12.2012 and 14.07.2011"
从字符串 (in ) 中获取这些日期的最佳和最快方法是DateTime
什么?
(仅字符串中第一次出现的日期)
理想的回报:
String 1: 16.03.2013 (as a DateTime)
String 2: 22.11.2012 (" ")
String 3: 23.12.2012 (" ")
所以我会调用一个类似的方法:
DateTime date1 = GetFirstDateFromString(string1);