01: /*
02: Copyright 2004-2007 Paul R. Holser, Jr. All rights reserved.
03: Licensed under the Academic Free License version 3.0
04: */
05:
06: package joptsimple.util;
07:
08: /**
09: * @since 2.1
10: * @author <a href="mailto:pholser@alumni.rice.edu">Paul Holser</a>
11: * @version $Id: StringUtilities.java,v 1.7 2007/04/10 20:06:27 pholser Exp $
12: */
13: public final class StringUtilities {
14: /**
15: * Do not instantiate -- statics only.
16: */
17: protected StringUtilities() {
18: throw new UnsupportedOperationException();
19: }
20:
21: /**
22: * Gives a string consisting of the given character repeated the given number of
23: * times.
24: *
25: * @param ch the character to repeat
26: * @param count how many times to repeat the character
27: * @return the resultant string
28: */
29: public static String repeat(char ch, int count) {
30: StringBuffer buffer = new StringBuffer();
31:
32: for (int i = 0; i < count; ++i)
33: buffer.append(ch);
34:
35: return buffer.toString();
36: }
37: }
|