Last active
March 4, 2020 18:33
-
-
Save felipebweber/300e1f3c5cbfd20519cf0f4f7a0eccbb to your computer and use it in GitHub Desktop.
Example add Percent Encoding
This file contains hidden or bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
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