addingPercentEscapes(using:)
Returns a representation of the receiver using a given encoding to determine the percent escapes necessary to convert the receiver into a legal URL string.
Declaration
func addingPercentEscapes(using enc: UInt) -> String?Parameters
- enc:
The encoding to use for the returned string. If you are uncertain of the correct encoding you should use Nsutf8stringencoding.
Return Value
A representation of the receiver using encoding to determine the percent escapes necessary to convert the receiver into a legal URL string. Returns nil if encoding cannot encode a particular character.
Discussion
It may be difficult to use this function to “clean up” unescaped or partially escaped URL strings where sequences are unpredictable. See CFURLCreateStringByAddingPercentEscapes(_:_:_:_:_:) for more information.
See Also
Related Documentation
Deprecated
string(withCString:)init(CString:)string(withCString:length:)init(CString:length:)init(CStringNoCopy:length:freeWhenDone:)string(withContentsOfFile:)init(contentsOfFile:)string(withContentsOf:)init(contentsOfURL:)write(toFile:atomically:)write(to:atomically:)getCharacters(_:)cString()lossyCString()cStringLength()