toUrlOrNull

fun String.toUrlOrNull(): Url?

Return

a URL from this string if it's a valid URL with a supported protocol, or null otherwise