---
title: percentEncodedFragment
framework: foundation
role: symbol
role_heading: Instance Property
path: foundation/nsurlcomponents/percentencodedfragment
---

# percentEncodedFragment

The fragment URL component (the part after a # symbol) expressed as a URL-encoded string, or nil if not present.

## Declaration

```swift
var percentEncodedFragment: String? { get set }
```

## Discussion

Discussion For example, in the URL http://www.example.com/index.html#jumpLocation, the fragment is jumpLocation. If you set this value to something that is not a valid, percent-encoded string, this class throws an exception.

## See Also

### Accessing components in URL-encoded format

- [percentEncodedHost](foundation/nsurlcomponents/percentencodedhost.md)
- [percentEncodedPassword](foundation/nsurlcomponents/percentencodedpassword.md)
- [percentEncodedPath](foundation/nsurlcomponents/percentencodedpath.md)
- [percentEncodedQuery](foundation/nsurlcomponents/percentencodedquery.md)
- [percentEncodedUser](foundation/nsurlcomponents/percentencodeduser.md)
