singleChar static method
The code unit of a single-character value, for the C char parameters.
Implementation
static int singleChar(String value, String name) {
if (value.length != 1) throw ArgumentError.value(value, name, 'must be a single character');
return value.codeUnitAt(0);
}