---
title: deletePathExtension()
framework: foundation
role: symbol
role_heading: Instance Method
path: foundation/url/deletepathextension()
---

# deletePathExtension()

Returns a URL constructed by removing any path extension.

## Declaration

```swift
mutating func deletePathExtension()
```

## Discussion

Discussion If the URL has an empty path (e.g., http://www.example.com), then this function will do nothing.

## See Also

### Removing a path extension

- [deletingPathExtension()](foundation/url/deletingpathextension().md)
