You signed in with another tab or window. Reload to refresh your session.You signed out in another tab or window. Reload to refresh your session.You switched accounts on another tab or window. Reload to refresh your session.Dismiss alert
But in fact, "".linesWithSeparators is an empty iterator.
Either documentation or implementation has to be fixed. On one hand, the documented behavior is what I expected before reading, but on the other there probably are applications/libraries relying on the current one...
The text was updated successfully, but these errors were encountered:
@som-snytt said (edited on May 12, 2016 6:02:47 PM UTC):
In ancient times, it would claim hasNext and then throw on next. That was fixed when StringLike replaced RichString.
The doc is plain wrong, since "a\nb" and "a\nb\n" are both two elements.
However, the impl is also wrong because it ought to work like split, except retaining the separators in the preceding element.
According to http://www.scala-lang.org/api/2.11.8/index.html#scala.collection.immutable.StringLike@linesWithSeparators:Iterator[String], "The number of strings returned is one greater than the number of line end characters in this string. For an empty string, a single empty line is returned."
But in fact,
"".linesWithSeparators
is an empty iterator.Either documentation or implementation has to be fixed. On one hand, the documented behavior is what I expected before reading, but on the other there probably are applications/libraries relying on the current one...
The text was updated successfully, but these errors were encountered: