code: public static String parseHost(final String address) {
          int ep = address.indexOf(":");
          if (ep == -1 || ep == 0) {
              throw new IllegalArgumentException("invalid address '" + address + "'");
          }
          return address.substring(0, ep).trim();
      }
docs: Parses the host.
  
  @param address the address
  @return the string