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

String format

Extention method to string for String.Format

Source

public static string UseFormat(this string format, params object[] args)
{
    return string.Format(format, args);
}

Example

void StringFormatTest()
{
    var formatedText = "{0}-{1}-{2}".UseFormat(1, 2, 3);
}

Author: Rino Reji Cheriyan

Submitted on: 5 jul. 2014

Language: C#

Type: String

Views: 6083