private String toSeparatedString(List<String> stringList, char separator) {

        StringBuffer result = new StringBuffer();
        Iterator<String> it = stringList.iterator();
        while (it.hasNext()) {
            result.append(it.next());
            if (it.hasNext()) {
                result.append(separator);
            }
        }
        return result.toString();
    }
private String toSeparatedString ( List < String > stringList , char separator ) { StringBuffer result = new StringBuffer ( ) ; Iterator < String > it = stringList . iterator ( ) ; while ( it . hasNext ( ) ) { result . append ( it . next ( ) ) ; if ( it . hasNext ( ) ) { result . append ( separator ) ; } } return result . toString ( ) ; }
Concatenates the elements of the string list separated by the given separator character.<p>

@param stringList the list
@param separator the separator

@return the concatenated string