My input strings are of the format:
string a = "201101..";
string b = "199008..";
string c = "20110202";
How do I convert them to a date format of yyyymmdd
?
I know I can use DateTime.TryParse() on the 3rd type.
Here's what I have:
string tempdate = a;
DateTime actualdate;
char[] charsToTrim = { '.' };
tempdate = tempdate.TrimEnd(charsToTrim);
if (DateTime.TryParse(tempdate, out actualdate))
{
}