Format
Formats any value type
Source
public static string Format<T>(this T value, string format) where T : struct {
return string.Format(format, value);
}
Example
Console.WriteLine(DateTime.Now.Format("It's {0:t}"));
ExtensionMethod.NET Home of 872 C#, Visual Basic, F# and Javascript extension methods
Formats any value type
public static string Format<T>(this T value, string format) where T : struct {
return string.Format(format, value);
}
Console.WriteLine(DateTime.Now.Format("It's {0:t}"));