Alternative join and split in Ruby
Posted on 09 July 2008
Join
>> %w(tic tac toe) * "-"
=> "tic-tac-toe"
Split
>> "tic-tac-toe" / "-"
=> ["tic", "tac", "toe"]
Unfortunately, for split you’ll need this of course:
class String
alias / :split
end
;)
I'm Dejan Simic - a Ruby On Rails developer based in infamous Serbia, working remotely for USA companies for few years. I'm currently working for 