I have a scenario that a user may enter a format string to format some parameters.
How can i determine that a format string is not valid based on specific count of parameters in .NET Framework (C#)?
Is there any method in framework to do that? or I must try a manual way?
sample situation:
string format = "test {0}, {1}";
var res = string.Format(format, 23);
You can use Regex in order to validate format of string, below an article on MSDN
http://msdn.microsoft.com/fr-fr/library/system.text.regularexpressions.regex.aspx