Converting URL to String and back again

In Swift 5, Swift 4 and Swift 3
To convert String to URL:

URL(string: String)

or,

URL.init(string: "yourURLString")

And to convert URL to String:

URL.absoluteString

The one below converts the ‘contents’ of the url to string

String(contentsOf: URL)

Leave a Comment

Hata!: SQLSTATE[HY000] [1045] Access denied for user 'divattrend_liink'@'localhost' (using password: YES)