protected static String [ ] sortDescending ( String [ ] s ) { Arrays . sort ( s , new Comparator < String > ( ) { @ Override public int compare ( String o1 , String o2 ) { if ( o1 . length ( ) < o2 . length ( ) ) return 1 ; if ( o1 . length ( ) > o2 . length ( ) ) return - 1 ; return 0 ; } } ) ; return s ; }
sorts a string array in descending order of length