How can I verify that strings are in the format "dd.MM.yyyy HH:mm:ss.mmm"?
For example:
12.01.2011 13:26:10.000 13.05.2010 22:30:20.000
should be accepted, others should be rejected. I want to be able to do something like:
string c = "12.01.2011 13:26:10.000";
if (string.CompareFormat(c))
{
// do something
}
else
{
// do something else
}
You can use
TryParseExact: