Is it possible to create an extension method to format a string?

Viewed 2877

the question is really simple. How do we format strings in C#? this way:

 string.Format("string goes here with placeholders like {0} {1}", firstName, lastName);

Now, is it possible to create an extension method to do it this way?

 "string goes here {0} {1}".Format(firstName, lastName);

That's all.

9 Answers
Related