public static List < String > removeAddressPort ( List < String > stringList ) { List < String > adresNoPort = new ArrayList <> ( ) ; for ( String s : stringList ) { int index = s . indexOf ( ":" ) ; if ( index > - 1 ) { adresNoPort . add ( s . substring ( 0 , index ) ) ; continue ; } adresNoPort . add ( s ) ; } return adresNoPort ; }
Remove address port .