Fixed removeLineDelimiters method not working properly in CRLF files (\n was removed before \r\n)

This commit is contained in:
Abdelilah El Aissaoui 2024-08-18 20:45:34 +02:00
parent 45629528f2
commit 45a96ad4ea
No known key found for this signature in database
GPG Key ID: 7587FC860F594869

View File

@ -33,8 +33,10 @@ val String.dirPath: String
} }
fun String.removeLineDelimiters(): String { fun String.removeLineDelimiters(): String {
return this.removeSuffix("\n") return this
.removeSuffix("\r\n") .removeSuffix("\r\n")
.removeSuffix("\n")
} }
val String.lineDelimiter: String? val String.lineDelimiter: String?