Character constructor
Character(
- String value
Creates a Character with the specified character.
value
the character to wrap (must be a single character)
Throws InvalidArgumentException if the string is not exactly one character.
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
Implementation
Character(String value) : _value = _validateSingleChar(value);