ExtensionMethod.NET Home of 880 C#, Visual Basic, F# and Javascript extension methods

Fill

Different way to use String.Format

Source

public static string Fill(this string original, params object[] values)
{
	return string.Format(original, values);
}

Example

...
int transactionsCount = GetTransactionsCount();
string message = "We had {0} transactions.".Fill(transactionsCount);
...

Author: Victor Rodrigues

Submitted on: 13 mei 2009

Language: C#

Type: System.String

Views: 5777