(defn split-two [regexp string ch] (interpose ch (split regexp string))) (split-two #"\s+" "ab c de" "") #=> ("ab" "" "c" "" "de")
On May 13, 6:24 pm, joshua-choi <rbysam...@gmail.com> wrote: > I'd like to know if there's a standard function similar to > clojure.contrib.string/split that includes the characters between the > spitted string, or if there isn't one, how I might write one. In other > words, I'd like a function split* such that (split* #"\s+" "ab c de") > returns ("ab" " " "c" " " "de"). > > -- > You received this message because you are subscribed to the Google > Groups "Clojure" group. > To post to this group, send email to clojure@googlegroups.com > Note that posts from new members are moderated - please be patient with your > first post. > To unsubscribe from this group, send email to > clojure+unsubscr...@googlegroups.com > For more options, visit this group > athttp://groups.google.com/group/clojure?hl=en -- You received this message because you are subscribed to the Google Groups "Clojure" group. To post to this group, send email to clojure@googlegroups.com Note that posts from new members are moderated - please be patient with your first post. To unsubscribe from this group, send email to clojure+unsubscr...@googlegroups.com For more options, visit this group at http://groups.google.com/group/clojure?hl=en