In Python, I can do this:
>>> import string
>>> string.letters
'abcdefghijklmnopqrstuvwxyzABCDEFGHIJKLMNOPQRSTUVWXYZ'
Is there any way to do something similar in Clojure (apart from copying and pasting the above characters somewhere)? I looked through both the Clojure standard library and the java standard library and couldn't find it.
A properly non-ASCII-centric implementation:
Call this with "US-ASCII" and you'll get the desired result (except that uppercase letters come first). You could call it with
Charset.defaultCharset()
, but I suspect that you'd get far more than the ASCII letters on most systems, even in the USA.Caveat: only considers the basic multilingual plane. Wouldn't be too hard to extend to the supplementary planes, but it would take a lot longer, and the utility is questionable.
If you just want Ascii chars,
will yield,