Check If a URL is Valid
This is just a quick post showing how we can check if a URL is a valid one. URLs are often passed from third parties or user input, so they need to be checked before used. This function allows you to do just that, it will return true if the string is a valid URL. Feel free to copy and paste it and go from there.
e.g. valid “https://gophercoding.com/"
e.g. invalid “test string”