getCleanedText function

String getCleanedText(
  1. String text,
  2. int tabulationSpaceCount
)

Get cleaned text with normalized line endings and tabs replaced

Implementation

String getCleanedText(String text, int tabulationSpaceCount) {
  String cleanedText =
      replaceTabulations(text, tabulationSpaceCount).replaceAll("\r", "");

  if (!cleanedText.endsWith('\n')) {
    cleanedText += '\n';
  }

  return cleanedText;
}