>>395 Ruby

def f(s,d)
eval("['"+s.gsub(d,"','")+"']")
end
p f("1 2 3 4"," ")

実行結果
["1", "2", "3", "4"]