Advertisement
Not a member of Pastebin yet?
Sign Up,
it unlocks many cool features!
- import Foundation
- extension URL {
- public mutating func deleteQuery() {
- self = self.deletingQuery()
- }
- public func deletingQuery() -> URL {
- guard var components = URLComponents(url: self, resolvingAgainstBaseURL: false) else { return self }
- components.query = nil
- return components.url ?? self
- }
- }
Advertisement
Add Comment
Please, Sign In to add comment
Advertisement