---
title: deletingPathExtension()
framework: foundation
role: symbol
role_heading: Instance Method
path: foundation/url/deletingpathextension()
---

# deletingPathExtension()

Returns a URL constructed by removing any path extension.

## Declaration

```swift
func deletingPathExtension() -> URL
```

## Discussion

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

## See Also

### Removing a path extension

- [deletePathExtension()](foundation/url/deletepathextension().md)
