public static String arrayToString ( String [ ] strs ) { if ( strs . length == 0 ) { return "" ; } StringBuilder sbuf = new StringBuilder ( ) ; sbuf . append ( strs [ 0 ] ) ; for ( int idx = 1 ; idx < strs . length ; idx ++ ) { sbuf . append ( "," ) ; sbuf . append ( strs [ idx ] ) ; } return sbuf . toString ( ) ; }
Given an array of strings return a comma - separated list of its elements .