strlen method

int strlen(
  1. Pointer<Utf8> string
)

Returns the length of a null-terminated string -- the number of (one-byte) characters before the first null byte.

Implementation

static int strlen(Pointer<Utf8> string) {
  final Pointer<Uint8> array = string.cast<Uint8>();
  final Uint8List nativeString = array.asTypedList(_maxSize);
  return nativeString.indexWhere((char) => char == 0);
}