public String mkString ( String start , String sep , String end ) { StringBuilder ret = new StringBuilder ( start ) ; for ( int i = 0 ; i < inner . size ( ) ; i ++ ) { ret . append ( inner . get ( i ) ) ; if ( i != ( inner . size ( ) - 1 ) ) { ret . append ( sep ) ; } } return ret . append ( end ) . toString ( ) ; }
Looping without creating in iterator is faster so we reimplement some methods for speed