@Nullable public static String extractProtocol(@NotNull String url){
  int index=url.indexOf(URLUtil.SCHEME_SEPARATOR);
  if (index < 0)   return null;
  return url.substring(0,index);
}

@ Nullable public static String extractProtocol ( @ NotNull String url ) { int index = url . indexOf ( URLUtil . SCHEME_SEPARATOR ) ; if ( index < 0 ) return null ; return url . substring ( 0 , index ) ; }
extracts protocol from the given url . protocol is a substring from the beginning of the url till " : / / " .
