---
title: removingPercentEncoding
framework: foundation
role: symbol
role_heading: Instance Property
path: foundation/nsstring/removingpercentencoding
---

# removingPercentEncoding

Returns a new string made from the receiver by replacing all percent encoded sequences with the matching UTF-8 characters.

## Declaration

```swift
var removingPercentEncoding: String? { get }
```

## Return Value

Return Value A new string with the percent-encoded sequences removed, or nil if the receiver contains an invalid percent-encoding sequence.

## Discussion

Discussion important: You must call this method only on strings that you know to be percent-encoded. Calling this method on strings that are not percent-encoded can lead to misinterpreting a percent character as the beginning of a percent-encoded sequence.

## See Also

### Related Documentation

- [replacingPercentEscapes(using:)](foundation/nsstring/replacingpercentescapes(using:).md)
- [addingPercentEscapes(using:)](foundation/nsstring/addingpercentescapes(using:).md)

### Working with URL Strings

- [addingPercentEncoding(withAllowedCharacters:)](foundation/nsstring/addingpercentencoding(withallowedcharacters:).md)
