charCount method

int charCount()

Get the number of characters in a string.

Implementation

int charCount() {
  if (this == null) {
    throw ArgumentError('string: $this');
  }
  if (this!.isEmpty) {
    return 0;
  }
  return this!.length;
}