From: Christoph Date: 2005-05-22T17:21:45+09:00 Subject: Re: join not in Enumerable Jim Weirich schrieb: > > def join(sep='') > inject(nil) { |a, b| > a ? (a << sep << b.to_s) : "#{b}" > } > end > > It's p ([].join) # "" so this should be def join(sep="") if sep == "" inject('') { |a, b| a << b.inspect } else inject('') { |a, b| a << sep << b.inspect } end end /Christoph