Basic types Strings

A 32-bit Unicode character.

Literal characters may be written between single quotes:

    ' '
    '\n'
    '\{#03C0}'
    '\{GREEK SMALL LETTER PI}'

Every `Character` has a unique `Integer`-valued Unicode code point.

    Integer piCodePoint = '\{GREEK SMALL LETTER PI}'.integer; // #03C0
    Character pi = #03C0.character; // GREEK SMALL LETTER PI

Characters are `Enumerable`, so character ranges may be produced using the `measure()` and `span()` operators.

    value lowerLatinLetters = 'a'..'z';
    value upperLatinLetters = 'A':26;

Characters have a natural order determined by their Unicode code points. So, for example, `'a'<'b'`, since `'a'.integer<'b'.integer`.

By: Gavin
See also `String`

- `Anything`
  - `Object`
    - `Character` ...and other supertypes

- `Character`
  - `Comparable`
  - `Enumerable`
    - `Ordinal`
  - `Object`
    - `Anything`

no subtypes hierarchy

Initializer
`Character(Character character)`

Attributes
`codePoint` | See `integer`
`control` | Source Code `shared Boolean control` Determine if this character is an ISO control character.
`digit` | Source Code `shared Boolean digit` Determine if this character is a numeric digit. That is, if its Unicode general category is Nd.
`hash` | Source Code `shared actual Integer hash` The hash code for this `Character`, which is always its 32-bit Unicode code point. Refines `Object.hash`
`integer` | Source Code `shared Integer integer` The Unicode code point of the character, an `Integer` in the range `0..#10FFFF`. Aliases: `codePoint`
`letter` | Source Code `shared Boolean letter` Determine if this character is a letter. That is, if its Unicode general category is Lu, Ll, Lt, Lm, or Lo.
`lowercase` | Source Code `shared Boolean lowercase` Determine if this is a lowercase representation of the character. That is, if its Unicode general category is Ll.
`lowercased` | Source Code `shared Character lowercased` The lowercase representation of this character. Conversion of uppercase characters to lowercase is performed according to a locale-independent mapping that produces incorrect results in certain locales (e.g. `tr-TR`). Furthermore, this conversion always produces a single character, which is incorrect for characters whose uppercase representation comprises multiple characters, for example İ. Thus, `'İ'.lowercased` evaluates to `'i'`, whereas `"İ".lowercased` evaluates, more correctly, to the string `"i̇"`. Therefore, for most purposes, it is better to use `char.string.lowercased` instead of `char.lowercased`. See also `String.lowercased`, `uppercased`
`predecessor` | Source Code `shared actual Character predecessor` The character with the Unicode code point that is the predecessor of the unicode code point this character. Refines `Enumerable.predecessor` ultimately refines `Ordinal.predecessor`
`string` | Source Code `shared actual String string` A string containing just this character. Refines `Object.string`
`successor` | Source Code `shared actual Character successor` The character with the Unicode code point that is the successor of the unicode code point this character. Refines `Enumerable.successor` ultimately refines `Ordinal.successor`
`titlecase` | Source Code `shared Boolean titlecase` Determine if this is a title case representation of the character. That is, if its Unicode general category is Lt.
`titlecased` | Source Code `shared Character titlecased` The title case representation of this character.
`uppercase` | Source Code `shared Boolean uppercase` Determine if this is an uppercase representation of the character. That is, if its Unicode general category is Lu.
`uppercased` | Source Code `shared Character uppercased` The uppercase representation of this character. Conversion of lowercase characters to uppercase is performed according to a locale-independent mapping that produces incorrect results in certain locales (e.g. `tr-TR`). Furthermore, this conversion always produces a single character, which is incorrect for characters whose uppercase representation comprises multiple characters, for example ß. Thus, `'ß'.uppercased` evaluates to `'ß'`, whereas `"ß".uppercased` evaluates, more correctly, to the string `"SS"`. Therefore, for most purposes, it is better to use `char.string.uppercased` instead of `char.uppercased`. See also `String.uppercased`, `lowercased`
`whitespace` | Source Code `shared Boolean whitespace` Determine if this character is a whitespace character. The following characters are whitespace characters: LINE FEED, `\n` or `\{#000A}`, FORM FEED, `\f` or `\{#000C}`, CARRIAGE RETURN, `\r` or `\{#000D}`, HORIZONTAL TABULATION, `\t` or `\{#0009}`, LINE TABULATION, `\{#000B}`, FILE SEPARATOR, `\{#001C}`, GROUP SEPARATOR, `\{#001D}`, RECORD SEPARATOR, `\{#001E}`, UNIT SEPARATOR, `\{#001F}`, and any Unicode character in the general category Zs, Zl, or Zp that is not a non-breaking space.

Inherited Attributes
Attributes inherited from: `Object` `hash`, `string`
Attributes inherited from: `Enumerable<Other>` `predecessor`, `successor`
Attributes inherited from: `Ordinal<Other>` `predecessor`, `successor`

Methods
`compare` | Source Code `shared actual Comparison compare(Character other)` Compare this character with the given character, according to the Unicode code points of the characters. Refines `Comparable.compare`
`equals` | Source Code `shared actual Boolean equals(Object that)` Determines if the given object is a character with the same code point as this character. Refines `Object.equals`
`largerThan` | Source Code `shared actual Boolean largerThan(Character other)` Determine if this character's code point is larger than the given character's code point, returning `false` if the two characters represent the same code point. Refines `Comparable.largerThan`
`neighbour` | Source Code `shared actual Character neighbour(Integer offset)` The indirect successor or predecessor at the given `offset`, where: `x.neighbour(0) == x`, `x.neighbour(i+1) == x.neighbour(i).successor`, and `x.neighbour(i-1) == x.neighbour(i).predecessor`. Refines `Enumerable.neighbour`
`notLargerThan` | Source Code `shared actual Boolean notLargerThan(Character other)` Determine if this character's code point is smaller than or equal to the given character's code point, returning `true` if the two characters represent the same code point. Refines `Comparable.notLargerThan`
`notSmallerThan` | Source Code `shared actual Boolean notSmallerThan(Character other)` Determine if this character's code point is larger than or equal to the given character's code point, returning `true` if the two characters represent the same code point. Refines `Comparable.notSmallerThan`
`offset` | Source Code `shared actual Integer offset(Character other)` The difference between the Unicode code point of this character, and the Unicode code point of the given character. Refines `Enumerable.offset`
`offsetSign` | Source Code `shared actual Integer offsetSign(Character other)` The sign of the offset from the given value. Refines `Enumerable.offsetSign`
`smallerThan` | Source Code `shared actual Boolean smallerThan(Character other)` Determine if this character's code point is smaller than the given character's code point, returning `false` if the two characters represent the same code point. Refines `Comparable.smallerThan`

Inherited Methods
Methods inherited from: `Object` `equals()`
Methods inherited from: `Comparable<Other>` `compare()`, `largerThan()`, `notLargerThan()`, `notSmallerThan()`, `smallerThan()`
Methods inherited from: `Enumerable<Other>` `neighbour()`, `offset()`, `offsetSign()`