public static String [ ] removeDuplicateStrings ( String [ ] array ) { if ( ObjectKit . isEmpty ( array ) ) { return array ; } Set < String > set = new TreeSet < String > ( ) ; for ( String element : array ) { set . add ( element ) ; } return toStringArray ( set ) ; }
Remove duplicate Strings from the given array . Also sorts the array as it uses a TreeSet .