@@ -0,0 +1,1130 @@
+package edu.teco.dnd.util;%0A%0A/**%0A * Provides utility methods for handling Strings.%0A * %0A * @author Philipp Adolf%0A */%0Apublic class StringUtil %7B%0A%09/**%0A%09 * Joins an array of objects into a String. The objects will be separated by the given separator String. If null is passed null is returned.%0A%09 * %0A%09 * @param array the objects to join. Method will return null if null is passed for this parameter%0A%09 * @param separator String to put between each object. Will %3Cem%3Enot%3Cem%3E be added before the first or after the last object. If null nothing will be%0A%09 *%09%09put between the objects.%0A%09 * @return a concatenation of all objects separated by %3Ccode%3Eseparator%3C/code%3E or null if null was passed for %3Ccode%3Earray%3C/code%3E%0A%09 */%0A%09public static %3CT%3E String joinArray(T%5B%5D array, String separator) %7B%0A%09%09if (array == null) %7B%0A%09%09%09return null;%0A%09%09%7D%0A%09%09%0A%09%09if (separator == null) %7B%0A%09%09%09separator = %22%22;%0A%09%09%7D%0A%09%09final StringBuilder sb = new StringBuilder();%0A%09%09boolean addSeparator = false;%0A%09%09for (final T object : array) %7B%0A%09%09%09if (addSeparator) %7B%0A%09%09%09%09sb.append(separator);%0A%09%09%09%7D else %7B%0A%09%09%09%09addSeparator = true;%0A%09%09%09%7D%0A%09%09%09sb.append(object);%0A%09%09%7D%0A%09%09%0A%09%09return sb.toString();%0A%09%7D%0A%7D%0A

Add StringUtil