Character type, predicates and operations.

Dunaj uses host character type for Char.

JVM host specific: Dunaj supports primitive chars as function arguments and return values (subject to the number of arguments and combination of argument types).

Primary

In this section: Char char char? unchecked-char

Char

Available since version 1.0 (view source)

TYPE

A host character type.

JVM host specific: The Char type is a single 16-bit Unicode character.

char

Available since version 1.0 (alias of clojure.core/char)

Usage:
  • (char x)

Type signature:
  • (Any) → Char

Returns x coerced to Char type. Numeric inputs are subject to range checking.

char?

Available since version 1.0 (view source)

Usage:
  • (char? x)

Type signature: Predicate

Returns true if object x is an instance of Char type, false otherwise.

unchecked-char

Available since version 1.0 (alias of clojure.core/unchecked-char)

not referred automatically

Usage:
  • (unchecked-char x)

Type signature:
  • (Any) → Char

Returns x coerced to Char type. Does not check numeric inputs for allowed ranges. Subject to rounding or truncation.

See also: char, dunaj.math/num

Predicates

lower-case?

Available since version 1.0 (view source)

not referred automatically

Usage:
  • (lower-case? c)

Type signature:
  • (Char) → Boolean+

Returns true if c is in lower case, false otherwise.

See also: upper-case?

newline?

Available since version 1.0 (view source)

not referred automatically

Usage:
  • (newline? c)

Type signature:
  • (Char) → Boolean+

Returns true if c is an ASCII newline character, false otherwise.

See also: whitespace?

upper-case?

Available since version 1.0 (view source)

not referred automatically

Usage:
  • (upper-case? c)

Type signature:
  • (Char) → Boolean+

Returns true if c is in upper case, false otherwise.

See also: lower-case?

whitespace?

Available since version 1.0 (view source)

not referred automatically

Usage:
  • (whitespace? c)

Type signature:
  • (Char) → Boolean+

Returns true if c is an ASCII whitespace or control character, false otherwise.

Operations

In this section: lower-case upper-case

lower-case

Available since version 1.0 (view source)

not referred automatically

Usage:
  • (lower-case c)

Type signature:
  • (Char) → Char

Returns the lower case version of character c. Returns c if there is no lower case version.

upper-case

Available since version 1.0 (view source)

not referred automatically

Usage:
  • (upper-case c)

Type signature:
  • (Char) → Char

Returns the upper case version of character c. Returns c if there is no upper case version.