Format

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}"));

Description

Formats any value type

Details

Double click on the code to select all.

 

;