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. During the last 5 years I've been working remotely for some pretty awesome USA companies such as 