Skip to content

ProtoString newlineToBreak() Method

Seth Clydesdale edited this page Jun 5, 2015 · 1 revision

<< Back to DOM Node Methods

Examples

Converting newlines into breaks.

'Coffee\nCream\nSugar'.newlineToBreak(); // returns 'Coffee<br/>Cream<br/>Sugar'

Description

The newlineToBreak method converts newline characters into HTML break tags. This can be used to format text that contains newline characters for insertion into a DOM node.

Syntax

String.newlineToBreak();
Clone this wiki locally