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;
07:
08: /**
09: * @author <a href="mailto:pholser@alumni.rice.edu">Paul Holser</a>
10: * @version $Id: Helpers.java,v 1.6 2007/04/10 20:06:27 pholser Exp $
11: */
12: public final class Helpers {
13: public static final String LINE_SEPARATOR = System
14: .getProperty("line.separator");
15:
16: private Helpers() {
17: throw new UnsupportedOperationException();
18: }
19:
20: public static String join(String[] pieces, String separator) {
21: StringBuffer buffer = new StringBuffer();
22:
23: for (int i = 0; i < pieces.length; ++i) {
24: buffer.append(pieces[i]);
25:
26: if (i < pieces.length - 1)
27: buffer.append(separator);
28: }
29:
30: return buffer.toString();
31: }
32: }
|