I have a list like:
val arr = Array(\"a\", \"\", \"\", \"b\", \"c\", \"\")
I am looking for a way to create:
Array(\"a\", \"a\"
Not sure if this is an elegant way, but figured out one solution:
var temp = "" arr.map{ case "" => { temp }; case v => {temp=v; v } }