String - Br2Nl

A string extension method that line break 2 newline.

Try it

public static void Main()
{
	string str = "To break lines<br>in a text,<br />use the br element.";

	// C# Extension Method: String - Br2Nl
    string content = str.Br2Nl();
	
	Console.WriteLine(content);
}

View Source
public static partial class Extensions
{
    /// <summary>
    ///     A string extension method that line break 2 newline.
    /// </summary>
    /// <param name="this">The @this to act on.</param>
    /// <returns>A string.</returns>
    public static string Br2Nl(this string @this)
    {
        return @this.Replace("<br />", "\r\n").Replace("<br>", "\r\n");
    }
}