Java String Multiply multiplyString(String s, int count)

Here you can find the source of multiplyString(String s, int count)

Description

multiply String

License

Open Source License

Declaration

public static String multiplyString(String s, int count) 

Method Source Code

//package com.java2s;
/*//www  .j av a 2s  .  c  om
Copyright (C) 2013  Tobias B
    
    
    
odify
it under the terms of the GNU General Public License as published by
the Free Software Foundation, either version 3 of the License, or
(at your option) any later version.
    
jsync is distributed in the hope that it will be useful,
but WITHOUT ANY WARRANTY; without even the implied warranty of
MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE.  See the
GNU General Public License for more details.
    
You should have received a copy of the GNU General Public License
along with jsync.  If not, see <http://www.gnu.org/licenses/>.
 */

public class Main {
    public static String multiplyString(String s, int count) {
        final StringBuilder ret = new StringBuilder();
        for (int i = 0; i < count; i++) {
            ret.append(s);
        }
        return ret.toString();
    }
}

Related

  1. multiply(final String s, final Long factor)
  2. multiply(final String string, final int times)
  3. multiply(String original, int times)
  4. multiply(String self, int reps)
  5. multiply(String str11, String str22)
  6. multiplyString(String sourceStr, int count)
  7. multiplyStringWithInt(String strMultiplicand, int multiplier)