I am trying to make a function that validates an input string format and then replaces some values. The string should contain data in the following format:
string data = "'({today} - ({date1} + {date2}))', 'user', 'info'";
I want to make sure that the string is typed in the above format format(validate it), and if it is to replace the values of today, date1 and date2 with some values.
I am thinking of something like that, but I don't know if that is the best way:
if (data.Contains("{today}") && data.Contains("{date1}") && data.Contains("{date2}"))
{ }
Anybody can suggest something?