Given a character c and a number n, how can I create a String that consists of n repetitions of c? Doing it manually is too cumbersome:
StringBuilder sb = ne
Just add it to your own...
public static String generateRepeatingString(char c, Integer n) { StringBuilder b = new StringBuilder(); for (Integer x = 0; x < n; x++) b.append(c); return b.toString(); }
Or Apache commons has a utility class you can add.