stripPrefix method

Option<Path> stripPrefix(
  1. Path prefix
)

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

Implementation

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