Hello,

one solution : java API to the rescue :

(defn digits [s] (apply str (filter #(Character/isDigit %) s)))

or

(def digits (comp (partial apply str) (partial filter #(Character/isDigit
%))))

if you prefer a more haskellish form :-)

2009/2/12 wubbie <[email protected]>

>
> Hello,
>
> How can I do this? Do we have a function that checks if
> it's a char or digit?
>
> (digits "a2c3")
> -> "23"
>
> Thanks,
> sun
>
> >
>


-- 
Cordialement,

Laurent PETIT

--~--~---------~--~----~------------~-------~--~----~
You received this message because you are subscribed to the Google Groups 
"Clojure" group.
To post to this group, send email to [email protected]
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
-~----------~----~----~----~------~----~------~--~---

Reply via email to