1.3.0 permalink Arrow_down_16x16

split-with

clojure.core

  • (split-with pred coll)
Returns a vector of [(take-while pred coll) (drop-while pred coll)]

1 Example top

  • user=> (split-with (partial >= 3) [1 2 3 4 5])
    [(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/core.clj:2571 top

(defn split-with
  "Returns a vector of [(take-while pred coll) (drop-while pred coll)]"
  {:added "1.0"
   :static true}
  [pred coll]
    [(take-while pred coll) (drop-while pred coll)])
Vars in clojure.core/split-with:
Used in 0 other vars

Comments top

No comments for split-with. Log in to add a comment.