normalizeNewLines function

String normalizeNewLines(
  1. String text
)

converts all Line Feeds ($newLine) to Carriage Return (\r) Line Feed ($newLine)

Implementation

String normalizeNewLines(String text) =>
    text.replaceAll(newLine, '\n').replaceAll('\n', newLine);