stripPrefix method

WindowsPath? stripPrefix(
  1. WindowsPath prefix
)

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

Implementation

WindowsPath? stripPrefix(WindowsPath prefix) {
  if (!startsWith(prefix)) {
    return null;
  }
  final newPath = _string.substring(prefix._string.length);
  return WindowsPath(newPath);
}