Remove Empty Lines

Remove/Delete all empty lines from the text.




How This Converter Works

Removes blank lines, including lines containing whitespace, when a line-ending character follows them. Non-empty lines are retained.

Formula or rule

Output = input.replace(/^\s*[\r\n]/gm, '').

Example

Input
red\n\nblue
Calculation
The empty line between red and blue is removed.
Result
red\nblue