validate the formatString - of Type.ToString(formatString), Is there a builtin provision for this in C#?
<p>for example </p>

<p>DateTime dateTime= System.DateTime.Now;</p>

<p>//Get the formatString from user , example formatString = "dddd - d - mmmm";</p>

<p>//validate the formatStrong provided by the user.</p>

<p>if the format string is valid</p>

<p>string result = dateTime.ToString(formatString);</p>

<p>i know that one way would be to catch the expection while formatting.but i want to know if there is any class/method provided by .Net for this purpose.</p>

<p>Thanks.</p>
