• (join separator coll)
Returns a string of all elements in coll, separated by
separator. Like Perl's join.

1 Example top

  • (def test-v [1 2 3 4 5])
    
    (join "," test-v)
    "1,2,3,4,5"
Log in to add / edit an example.

See Also top

Log in to add a see also.

Plus_12x12 Minus_12x12 Source clojure/contrib/string.clj:229 top

(defn ^String join
  "Returns a string of all elements in coll, separated by
  separator.  Like Perl's join."
  {:deprecated "1.2"}
  [^String separator coll]
  (apply str (interpose separator coll)))
Vars in clojure.contrib.string/join: apply defn interpose str
Used in 0 other vars

Comments top

1 comment(s) for join.

I was thinking about how to delimit a sequence for creating .csv files. join looks like a very good candidate for adding non-trailing delimiters to sequences, so they can be written out as .csv files.

Log in to add a comment.