I am learning scala right now. When I wrote a statement as below,
"abcdpqrs".split("").grouped(2).map(_.mkString("")).mkString("|")
i expected it to print,
ab|cd|pq|rs
but instead it is printing,
a|bc|dp|qr|s
I find this behaviour erratic. Am I missing something or is there anything else which can partition the list as I expected?