static String listToCommaDelimitedString(List<String> list){
  StringBuilder result=new StringBuilder();
  for (  String str : list) {
    if (result.length() > 0) {
      result.append(",");
    }
    result.append(str);
  }
  return result.toString();
}

static String listToCommaDelimitedString ( List < String > list ) { StringBuilder result = new StringBuilder ( ) ; for ( String str : list ) { if ( result . length ( ) > 0 ) { result . append ( "," ) ; } result . append ( str ) ; } return result . toString ( ) ; }
convers the given list of string to a comma - separated string .
