splitLength method

int splitLength({
  1. String separator = "/",
})

Measure the length of path.

By entering separator, it can be used for purposes other than paths.

Implementation

int splitLength({String separator = "/"}) {
  if (isEmpty) {
    return 0;
  }
  final paths = split(separator);
  final length = paths.length;
  return length;
}