I have an Iterator[String] that I want to convert to a String in Scala. I would expect the following to work, but I get no output. What am I doing wrong?
val it = Iterator("a", "number", "of", "words")
val combined = "";
while (it.hasNext){
combined = combined + it.next()
}
println(combined)
val.