removeEmptyLines property

String get removeEmptyLines

Removes consecutive empty lines, replacing them with single newlines. Example: "Line1\n\n\nLine2" => "Line1\nLine2"

Implementation

String get removeEmptyLines =>
    replaceAll(RegExp(r'(?:[\t ]*(?:\r?\n|\r))+'), '\n');