You could do it by using the word boundary regexp operator.
(ns foo.bar
(:use [clojure.contrib.string :only [split]]))
(defn split* [s]
(drop 1 (split #"\b" s)))
(split* "ab c de")
;; ("ab" " " "c" " " "de")
-Drew
On Thu, May 13, 2010 at 11:24, joshua-choi <[email protected]> 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 [email protected]
> Note that posts from new members are moderated - please be patient with your
> first post.
> To unsubscribe from this group, send email to
> [email protected]
> For more options, visit this group at
> http://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 [email protected]
Note that posts from new members are moderated - please be patient with your
first post.
To unsubscribe from this group, send email to
[email protected]
For more options, visit this group at
http://groups.google.com/group/clojure?hl=en