andre
andre

Reputation: 329

char representation clojure

How can I represent a char (character) in clojure?

Also I would like an example to test it using the char? function

(println (char? 1))
(println (char? (char 'a')))

Upvotes: 3

Views: 116

Answers (1)

Óscar López
Óscar López

Reputation: 236004

Use a backslash for representing an individual character. For instance:

(char? \a)

returns true

Upvotes: 3

Related Questions