Thursday, July 21, 2011

Property based template parsing

The usage of string.Format is widely known and appreciated. It provides a simple and clean way to build parametrized strings. However, this method can become somewhat obscure when there is a large string (e.g. template) to be formatted. Sometimes lot of parameters are needed and all the parameter numbers make not much sense on a page sized string. In this case named parameters or template variable names would be desired.