---
title: "starts(with:)"
framework: system
role: symbol
role_heading: Instance Method
path: "system/filepath/starts(with:)"
---

# starts(with:)

Returns whether other is a prefix of self, only considering whole path components.

## Declaration

```swift
func starts(with other: FilePath) -> Bool
```

## Discussion

Discussion Example: let path: FilePath = "/usr/bin/ls" path.starts(with: "/")              // true path.starts(with: "/usr/bin")       // true path.starts(with: "/usr/bin/ls")    // true path.starts(with: "/usr/bin/ls///") // true path.starts(with: "/us")            // false
