public static String arrayCombine(String[] list,char separatorChar){
  StatementBuilder buff=new StatementBuilder();
  for (  String s : list) {
    buff.appendExceptFirst(String.valueOf(separatorChar));
    if (s == null) {
      s="";
    }
    for (int j=0, length=s.length(); j < length; j++) {
      char c=s.charAt(j);
      if (c == '\\' || c == separatorChar) {
        buff.append('\\');
      }
      buff.append(c);
    }
  }
  return buff.toString();
}

public static String arrayCombine ( String [ ] list , char separatorChar ) { StatementBuilder buff = new StatementBuilder ( ) ; for ( String s : list ) { buff . appendExceptFirst ( String . valueOf ( separatorChar ) ) ; if ( s == null ) { s = "" ; } for ( int j = 0 , length = s . length ( ) ; j < length ; j ++ ) { char c = s . charAt ( j ) ; if ( c == '\\' || c == separatorChar ) { buff . append ( '\\' ) ; } buff . append ( c ) ; } } return buff . toString ( ) ; }
combine an array of strings to one array using the given separator character . a backslash and the separator character and escaped using a backslash .
