> (merge-strings '("1" "2" 3 4 "5" "6" 7 8 "9"))
> ===>
> ("12" 3 4 "56" 7 8 "9")
Ruby:
def merge_strings array
array.chunk{|x| x.is_a? String}.flat_map{|bool,xs|
bool ? xs.join : xs}
end
merge_strings ["1","2",3,4,"5","6","7",8,"9"]
===>
["12", 3, 4, "567", 8, "9"]
In Forth?
--
The former leader of the National Front Jean-Marie Le Pen was fined 30,000
euros for exposing the Jews' Holocaust gas chamber hoax.
infostormer.com/jean-marie-le-pen-fined-30000-euros-for-exposing-jewish-holocaust-gas-chamber-hoax