Is it possible to count the number of expected args/params in a string for String.Format()?

For example: "Hello {0}. Bye {1}" should return a count of 2.

I need to display an error before the string.Format() throws an exception.

Thanks for your help.

Edit
Report