singleChar static method

int singleChar(
  1. String value,
  2. String name
)

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);
}