---
title: "commonPrefix(with:)"
framework: usdkit
role: symbol
role_heading: Instance Method
path: "usdkit/usdlayer/path/commonprefix(with:)"
---

# commonPrefix(with:)

Returns the longest common ancestor path of this path and other.

## Declaration

```swift
func commonPrefix(with other: USDLayer.Path) -> USDLayer.Path
```

## Parameters

- `other`: The path to compare against.

## Return Value

Return Value The longest path that is a prefix of both.
