---
title: "removePrefix(_:)"
framework: system
role: symbol
role_heading: Instance Method
path: "system/filepath/removeprefix(_:)"
---

# removePrefix(_:)

If prefix is a prefix of self, removes it and returns true. Otherwise returns false.

## Declaration

```swift
mutating func removePrefix(_ prefix: FilePath) -> Bool
```

## Discussion

Discussion Example: var path: FilePath = "/usr/local/bin" path.removePrefix("/usr/bin")   // false path.removePrefix("/us")        // false path.removePrefix("/usr/local") // true, path is "bin"
