C# Extension Method: String - FormatWith

CSharp · Console

/Program.cs

// C# Extension Method
// Doc: https://csharp-extension.com/en/method/1002079/string-formatwith

// @nuget: Z.ExtensionMethods
using System;
					
public class Program
{
    public static string FileName = "test.xml";

    public static void Main()
    {
        var text = @"Time now: {0}";

        //C# Extension Method: String - FormatWith
        var timeNow = text.FormatWith(DateTime.Now);

        Console.WriteLine(timeNow);
    }
}
;