Given that the first is a valid date, and the second is a different representation of the date, the simplest method with the least code for your example:
string newString = DateTime.ParseExact("11/12/2010", "MM/dd/yyyy").ToString("yyyyMMdd")
David source
share