normalizeLineEndings function

String normalizeLineEndings(
  1. String text
)

Folds CRLF (\r\n) and lone CR (\r) into LF (\n).

Binds: FR-103.

Implementation

String normalizeLineEndings(String text) {
  return text.replaceAll('\r\n', '\n').replaceAll('\r', '\n');
}