Character class

A wrapper class for single characters that provides Java-like functionality.

This class wraps a single character (represented as a String in Dart) and provides utility methods similar to Java's Character class.

Example usage:

Character a = Character('A');
Character b = Character.valueOf('z');

print(a.isUpperCase()); // true
print(a.toLowerCase()); // Character('a')
print(Character.isDigit('5')); // true
Implemented types

Constructors

Character(String value)
Creates a Character with the specified character.

Properties

codePoint → int
Returns the Unicode code point of this character.
no setter
hashCode → int
Returns the hash code for this Character.
no setteroverride
runtimeType → Type
A representation of the runtime type of the object.
no setterinherited
value → String
Returns the wrapped character value.
no setter

Methods

compareTo(Character other) → int
Compares this Character with another Character.
override
isDigit() → bool
Returns true if this character is a digit (0-9).
isLetter() → bool
Returns true if this character is a letter.
isLetterOrDigit() → bool
Returns true if this character is a letter or digit.
isLowerCase() → bool
Returns true if this character is lowercase.
isUpperCase() → bool
Returns true if this character is uppercase.
isWhitespace() → bool
Returns true if this character is whitespace.
noSuchMethod(Invocation invocation) → dynamic
Invoked when a nonexistent method or property is accessed.
inherited
toLowerCase() → Character
Converts this character to lowercase.
toString() → String
Returns a string representation of this Character.
override
toUpperCase() → Character
Converts this character to uppercase.

Operators

operator ==(Object other) → bool
Returns true if this Character equals the specified object.
override

Static Methods

valueOf(String char) → Character
Returns a Character instance representing the specified character.