Skip to content

Instantly share code, notes, and snippets.

@felipebweber
Last active March 4, 2020 18:33
Show Gist options
  • Save felipebweber/300e1f3c5cbfd20519cf0f4f7a0eccbb to your computer and use it in GitHub Desktop.
Save felipebweber/300e1f3c5cbfd20519cf0f4f7a0eccbb to your computer and use it in GitHub Desktop.
Example add Percent Encoding
import Foundation
let city = "Newcastle upon Tyne"
let addPercentEncoding = city.addingPercentEncoding(withAllowedCharacters: CharacterSet(charactersIn: " ").inverted)
print(addPercentEncoding) //("Newcastle%20upon%20Tyne")
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment