Is it possible to instruct DateTime.TryParseExact to accept multiple (any) sepatators (specify separator placeholder instead of particular separator)? For instance:
DateTime.TryParseExact(performanceRow[5], "M/d/yyyy",
CultureInfo.InvariantCulture, DateTimeStyles.AllowWhiteSpaces, out startDate)
This works if date has ‘/’ character as separator. However I’ve just received a file with ‘.’ as separator, and parsing fails.
Thanks
Use this variant of TryParseExact
MSDN link
The second param is a string array which is defined as
The description says: The format of the string representation must match at least one of the specified formats exactly.