restoreLineEndings function
Re-encodes LF text with the requested line ending.
Implementation
String restoreLineEndings(String text, LineEnding ending) {
return ending == LineEnding.crlf ? text.replaceAll('\n', '\r\n') : text;
}
Re-encodes LF text with the requested line ending.
String restoreLineEndings(String text, LineEnding ending) {
return ending == LineEnding.crlf ? text.replaceAll('\n', '\r\n') : text;
}