stripPrefix method

Option<UnixPath> stripPrefix(
  1. UnixPath prefix
)

Returns a path that, when joined onto base, yields this. Returns None if prefix is not a subpath of base.

Implementation

Option<UnixPath> stripPrefix(UnixPath prefix) {
  if (!startsWith(prefix)) {
    return None;
  }
  final newPath = _string.substring(prefix._string.length);
  return Some(UnixPath(newPath));
}