Combines an unknown number of Strings to one String.

@param args multiple Strings
@return the combined string
198353
static String combine(final String... args) {
        final StringBuilder builder = new StringBuilder();
        for (final String arg : args) {
            builder.append(arg);
        }
        return builder.toString();
    }
697742
public static String compose (String key, Object... args)
    {
        StringBuilder buf = new StringBuilder();
        buf.append(key);
        buf.append('|');
        for (int i = 0; i < args.length; i++) {
            if (i > 0) {
                buf.append('|');
            }
            // escape the string while adding to the buffer
            String arg = (args[i] == null) ? "" : String.valueOf(args[i]);
            int alength = arg.length();
            for (int p = 0; p < alength; p++) {
                char ch = arg.charAt(p);
                if (ch == '|') {
                    buf.append("\\!");
                } else if (ch == '\\') {
                    buf.append("\\\\");
                } else {
                    buf.append(ch);
                }
            }
        }
        return buf.toString();
    }
233987
protected String getParameterAsString(Object arg) {
        if (arg instanceof String) {
            return (String) arg;
        }
        return arg == null ? "null" : arg.toString();
    }
1191782
public static String concatStringWithDelimiter(String[] strings, String delimiter) {
        StringBuilder sbr = new StringBuilder();
        int size = strings.length;
        for (int i = 0; i < size - 1; i++) {
            sbr.append(strings[i]).append(delimiter);
        }
        sbr.append(strings[size - 1]);
        return sbr.toString();
    }
1229513
public static String compose (String key, String... args)
    {
        return compose(key, (Object[]) args);
    }
101684
public FormattedStringBuilder append(String ... strings) {
        for(String s: strings) {
            _delegate.append(s);
        }
        return this;
    }
815201
public static String arrayAsString(final String[] arg, String separator) {

        StringBuffer result = new StringBuffer();
        for (int i = 0; i < arg.length; i++) {
            result.append(arg[i]);
            if ((i + 1) < arg.length) {
                result.append(separator);
            }
        }
        return result.toString();
    }
1264100
public static String[] expandArguments(String[] args) throws Exception {
        List<String> options = new ArrayList<String>();

        for (int i = 0; i < args.length; i++) {
            if (args[i].equals(OPTIONS_FILE)) {
                if (i == args.length - 1) {
                    throw new Exception("Missing options file");
                }

                String fileName = args[++i];
                File optionsFile = new File(fileName);
                BufferedReader reader = null;
                StringBuilder buffer = new StringBuilder();
                try {
                    reader = new BufferedReader(new FileReader(optionsFile));
                    String nextLine = null;
                    while ((nextLine = reader.readLine()) != null) {
                        nextLine = nextLine.trim();
                        if (nextLine.length() == 0 || nextLine.startsWith("#")) {
                            // empty line or comment
                            continue;
                        }

                        buffer.append(nextLine);
                        if (nextLine.endsWith("\\")) {
                            if (buffer.charAt(0) == '\'' || buffer.charAt(0) == '"') {
                                throw new Exception(
                                        "Multiline quoted strings not supported in file("
                                        + fileName + "): " + buffer.toString());
                            }
                            // Remove the trailing back-slash and continue
                            buffer.deleteCharAt(buffer.length()  - 1);
                        } else {
                            // The buffer contains a full option
                            options.add(
                                    removeQuotesEncolosingOption(fileName, buffer.toString()));
                            buffer.delete(0, buffer.length());
                        }
                    }

                    // Assert that the buffer is empty
                    if (buffer.length() != 0) {
                        throw new Exception("Malformed option in options file("
                                + fileName + "): " + buffer.toString());
                    }
                } catch (IOException ex) {
                    throw new Exception("Unable to read options file: " + fileName, ex);
                } finally {
                    if (reader != null) {
                        try {
                            reader.close();
                        } catch (IOException ex) {
                            LOG.info("Exception while closing reader", ex);
                        }
                    }
                }
            } else {
                // Regular option. Parse it and put it on the appropriate list
                options.add(args[i]);
            }
        }

        return options.toArray(new String[options.size()]);
    }
972365
public static String getString(String aKey, Object arg)
    {
        return getString(aKey,new Object[]{arg});
    }
197003
function combineStrings(types, opts) {
  var symbols = {};
  var i, l, type, typeSymbols;
  for (i = 0, l = types.length; i < l; i++) {
    type = types[i];
    if (type.typeName === 'string') {
      // If at least one of the types is a string, it will be the supertype.
      return type;
    }
    typeSymbols = type.symbols;
    var j, m;
    for (j = 0, m = typeSymbols.length; j < m; j++) {
      symbols[typeSymbols[j]] = true;
    }
  }
  return Type.forSchema({type: 'enum', symbols: Object.keys(symbols)}, opts);
}
145726
public static String[] removeFirst(String[] args) {
		String[] args2 = new String[args.length - 1];
		System.arraycopy(args, 1, args2, 0, args2.length);
		return args2;
	}
245823
public static String joiningWithDelimiter(CharSequence delimiter,
            String... strings) {
        return joiningWith(Arrays.stream(strings), delimiter);
    }
357941
protected String join(Object[] values)
    {
        StringBuilder sb = new StringBuilder(100);
        if(values.length == 0)
            return sb.toString();

        sb.append(values[0]);

        if(values.length == 1)
            return sb.toString();

        for (int i = 1; i < values.length; i++)
        {
            sb.append(",").append(values[i]);
        }

        return sb.toString();
    }
372462
static Map<String, Object> merge(List<Map<String, Object>> args) {
        if (args.size() > 1) {
            Map<String, Object> obj = args.get(0);
            for (int i = 1; i < args.size(); i++) {
                obj = mergeTwo(obj, args.get(i));
            }
            return obj;
        } else if (args.size() == 1) {
            return args.get(0);
        } else {
            return null;
        }
    }
362082
public static Argument merge(int symbol, List<Argument> arguments) {
        AgBuffer buffer;
        List<AgBuffer> argBuffers;
        int i;
        int max;
        Attribute start;
        Argument arg;
        Type mergedType;
        int card;
        List<Definition> resultingSources;

        max = arguments.size();
        if (max == 0) {
            throw new IllegalArgumentException();
        }
        argBuffers = new ArrayList<>();
        mergedType = null;
        resultingSources = new ArrayList<>();
        for (i = 0; i < max; i++) {
            arg = arguments.get(i);
            resultingSources.addAll(arg.sources);
            if (arg == null) {
                throw new IllegalStateException();
            }
            argBuffers.add(arg.copyBuffer);
            if (mergedType == null) {
                mergedType = arg.attr.type;
            } else {
                mergedType = mergedType.alternate(arg.attr.type);
            }
        }
        if (mergedType == null) {
            throw new IllegalStateException();
        }
        // compute with card SEQUENCE. TODO: very expensive
        buffer = new AgBuffer((Attribute) null);
        start = buffer.merge(argBuffers, symbol, new Type(mergedType.type, Type.SEQUENCE));
        card = buffer.calcCard(start);
        buffer = new AgBuffer((Attribute) null);
        // TODO: duplicate computation ...
        start = buffer.merge(argBuffers, symbol, new Type(mergedType.type, card));
        buffer.setStart(start);
        return new Argument(Path.ISOLATED, buffer, resultingSources);
    }
1342306
public static String replace(String str, String regex, String... args) {
		int length = args.length;
		for (int i = 0; i < length; i++) {
			str = str.replaceFirst(regex, args[i]);
		}
		return str;
	}
384268
function join(args) {
  var arg;
  var i = 0;
  var path = '';

  if (arguments.length === 0) {
    return utils.sep;
  }

  while ((arg = arguments[i++])) {
    if (typeof arg !== 'string') {
      throw new TypeError('utils.join() expects string arguments');
    }

    path += utils.sep + arg;
  }

  path = path.replace(/\/+/g, utils.sep);
  if (path[path.length - 1] === utils.sep) {
    path = path.substring(0, path.length - 1);
  }
  return path;
}