Logo Questions Linux Laravel Mysql Ubuntu Git Menu
 

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')))
like image 280
andre Avatar asked Feb 01 '26 20:02

andre


1 Answers

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

(char? \a)

returns true

like image 138
Óscar López Avatar answered Feb 04 '26 14:02

Óscar López



Donate For Us

If you love us? You can donate to us via Paypal or buy me a coffee so we can maintain and grow! Thank you!