getCleanedText function
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;
}