public static String repeatString ( String pattern , int repeats ) { StringBuilder buffer = new StringBuilder ( pattern . length ( ) * repeats ) ; for ( int i = 0 ; i < repeats ; i ++ ) { buffer . append ( pattern ) ; } return new String ( buffer ) ; }
Returns a string made up of repetitions of the specified string .