How to verify if a String in Java is a valid URL?
Advertisement
Answer
You can try to create a java.net.URL
object out of it. If it is not a proper URL, a MalformedURLException
will be thrown.
How to verify if a String in Java is a valid URL?
You can try to create a java.net.URL
object out of it. If it is not a proper URL, a MalformedURLException
will be thrown.