run this line in ruby...

["",""].join("/").split("/")

you get an empty array :-(

How can i split the string and get an the same result i had before
joining them?

i had a directory name and got some verry irritating behaviour this
way...

"/dir".split("/") gives the same result as "/dir/".split("/") :-(

so "/dir/".split("/").join("/") gives not "/dir/" but "/dir" :-(

Greetings,
Erich