a and b are values of Iterator[String] type. I need c to include all the elements of a and b. Surprisingly I can't figure out how to achieve this. May you happen to know?
1 Answer
++ operator will do that work.
An example:
scala> val a = "abcd".combinations(2)
//a: Iterator[String] = non-empty iterator
scala> val b = "efg".combinations(2)
//b: Iterator[String] = non-empty iterator
scala> val c = a++b
//c: Iterator[String] = non-empty iterator
scala> c.toList
//res0: List[String] = List(ab, ac, ad, bc, bd, cd, ef, eg, fg)
2 Comments
Display Name
Well, it's not really an operator, but it's still good reference.
itsbruce
@SargeBorsch It's no more incorrect to call a Scala infix unary method an operator than it is for a Haskell infix function.