private static String pickDelimiter ( String [ ] strings ) { boolean allLength1 = true ; for ( String s : strings ) { if ( s . length ( ) != 1 ) { allLength1 = false ; break ; } } if ( allLength1 ) { return "" ; } String [ ] delimiters = new String [ ] { " " , ";" , "," , "{" , "}" , null } ; int i = 0 ; NEXT_DELIMITER : for ( ; delimiters [ i ] != null ; i ++ ) { for ( String cur : strings ) { if ( cur . contains ( delimiters [ i ] ) ) { continue NEXT_DELIMITER ; } } break ; } return delimiters [ i ] ; }
Find a delimiter that does not occur in the given strings