Sha256: cfa54a0e73624ff790da4696a86d09bc854f2168e97b21c9aaabd70622d1562f

Contents?: true

Size: 231 Bytes

Versions: 4

Compression:

Stored size: 231 Bytes

Contents

class Array
  def join_with( sep, fin=nil )
    s = join(sep)
    if fin
      rsep = Regexp.escape(sep.to_s)
      rlast = Regexp.escape(last.to_s)
      s.sub!(/#{rsep}#{rlast}$/,"#{fin}#{last}")
    end
    return s
  end
end

Version data entries

4 entries across 4 versions & 1 rubygems

Version Path
facets-1.8.49 work/core/join_with.rb
facets-1.8.0 work/core/join_with.rb
facets-1.8.20 work/core/join_with.rb
facets-1.8.8 work/core/join_with.rb