We read every piece of feedback, and take your input very seriously.
To see all available qualifiers, see our documentation.
There was an error while loading. Please reload this page.
1 parent 89e2683 commit 1e97219Copy full SHA for 1e97219
library/src/scala/collection/StringOps.scala
@@ -628,6 +628,14 @@ final class StringOps(private val s: String) extends AnyVal {
628
* end characters; i.e., apply `.stripLineEnd` to all lines
629
* returned by `linesWithSeparators`.
630
*/
631
+ def linesIterator: Iterator[String] =
632
+ linesWithSeparators map (_.stripLineEnd)
633
+
634
+ /** Return all lines in this string in an iterator, excluding trailing line
635
+ * end characters; i.e., apply `.stripLineEnd` to all lines
636
+ * returned by `linesWithSeparators`.
637
+ */
638
+ @deprecated("Use .linesIterator, because JDK 11 adds a `lines` method on String", "2.13.0")
639
def lines: Iterator[String] =
640
linesWithSeparators map (_.stripLineEnd)
641
0 commit comments