Java: Common way to validate and convert “host:port” to InetSocketAddress?
I myself propose one possible workaround solution. Convert a string into URI (this would validate it automatically) and then query the URI’s host and port components. Sadly, an URI with a host component MUST have a scheme. This is why this solution is “not perfect”. String string = … // some string which has to … Read more