UtilHtmlNewLineToHtmlBreak Method

Replaces new lines (\r\n or \n) in an HTML string, by HTML break tags ("<br>").

This functionality is also known as 'nl2br'.

Definition

Namespace: DevCase.Core.DataProcessing.Html
Assembly: DevCase.net48 (in DevCase.net48.dll) Version: 6.0.0.0 (6.0)
XMLNS for XAML: Not mapped to an xmlns.
public static string NewLineToHtmlBreak(
	string html,
	bool is_xhtml = false
)

Parameters

html  String
The source HTML string.
is_xhtml  Boolean  (Optional)
Optional. True to use "<br />" XHTML-style break tags instead of "<br>" HTML break tags.

Default value: false

Return Value

String
The modified HTML string with line breaks replaced by HTML break tags.

Example

This is a code example.
C#
No code example is currently available or this language may not be supported.

See Also