Document that lines and lineSequence do not preserve line separators

This commit is contained in:
Ilya Gorbunov
2018-09-25 09:05:09 +03:00
parent 21b71f3bb1
commit 08822ff14b
+5 -1
View File
@@ -1262,10 +1262,14 @@ public inline fun CharSequence.split(regex: Regex, limit: Int = 0): List<String>
/** /**
* Splits this char sequence to a sequence of lines delimited by any of the following character sequences: CRLF, LF or CR. * 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<String> = splitToSequence("\r\n", "\n", "\r") public fun CharSequence.lineSequence(): Sequence<String> = 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<String> = lineSequence().toList() public fun CharSequence.lines(): List<String> = lineSequence().toList()