public static String stripDomain ( String hostname ) { String ret = hostname ; int pos = hostname . indexOf ( "." ) ; if ( pos != - 1 ) ret = hostname . substring ( 0 , pos ) ; return ret ; }
Returns the given hostname with the domain removed .