From 08822ff14b5a1f96aa3d908e2b3621060b79be3e Mon Sep 17 00:00:00 2001 From: Ilya Gorbunov Date: Tue, 25 Sep 2018 09:05:09 +0300 Subject: [PATCH] Document that lines and lineSequence do not preserve line separators --- libraries/stdlib/src/kotlin/text/Strings.kt | 6 +++++- 1 file changed, 5 insertions(+), 1 deletion(-) diff --git a/libraries/stdlib/src/kotlin/text/Strings.kt b/libraries/stdlib/src/kotlin/text/Strings.kt index 82d53bdc07f..e4d1c3e2b29 100644 --- a/libraries/stdlib/src/kotlin/text/Strings.kt +++ b/libraries/stdlib/src/kotlin/text/Strings.kt @@ -1262,10 +1262,14 @@ public inline fun CharSequence.split(regex: Regex, limit: Int = 0): List /** * Splits this char sequence to a sequence of lines delimited by any of the following character sequences: CRLF, LF or CR. + * + * The lines returned do not include terminating line separators. */ public fun CharSequence.lineSequence(): Sequence = splitToSequence("\r\n", "\n", "\r") /** - * * Splits this char sequence to a list of lines delimited by any of the following character sequences: CRLF, LF or CR. + * Splits this char sequence to a list of lines delimited by any of the following character sequences: CRLF, LF or CR. + * + * The lines returned do not include terminating line separators. */ public fun CharSequence.lines(): List = lineSequence().toList()