Created
September 21, 2016 12:02
-
-
Save taggon/6e48c48296accb6a139a4b6839b85cc0 to your computer and use it in GitHub Desktop.
encodeURIComponent equivalent in Swift3
This file contains 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
extension String { | |
func encodeURIComponent() -> String? { | |
let characterSet = NSMutableCharacterSet.urlQueryAllowed | |
return self.addingPercentEncoding(withAllowedCharacters: characterSet) | |
} | |
} |
Sign up for free
to join this conversation on GitHub.
Already have an account?
Sign in to comment