returns the scheme prefix like `` http '' from the url spec , or null if the spec does n't start with a scheme . scheme prefixes match this pattern : alpha alpha | digit | ' + ' | ' - ' | ' . ' ' : ' concode_field_sep PlaceHolder placeHolder concode_field_sep String authoritySafePath concode_elem_sep String canonicalizePath concode_elem_sep int findFirstOf concode_elem_sep boolean isValidSchemeChar
String function ( String arg0 ) { int loc0 = arg0 . indexOf ( ':' ) ; if ( loc0 < 1 ) { return null ; } for ( int loc1 = 0 ; loc1 < loc0 ; loc1 ++ ) { char loc2 = arg0 . charAt ( loc1 ) ; if ( ! isValidSchemeChar ( loc1 , loc2 ) ) { return null ; } } return arg0 . substring ( 0 , loc0 ) . toLowerCase ( Locale . US ) ; }