package com.timepath;

import java.util.logging.Logger;

/**
 * @author TimePath
 */
public class StringUtils {

    private static final Logger LOG = Logger.getLogger(StringUtils.class.getName());

    private StringUtils() {
    }

    public static String capitalize(String str) {
        if (str == null) {
            return null;
        }
        if (str.isEmpty()) {
            return "";
        }
        return Character.toUpperCase(str.charAt(0)) + ((str.length() > 1) ? str.substring(1).toLowerCase() : "");
    }

    public static String fromDoubleArray(Object[][] debug, String title) {
        StringBuilder sb = new StringBuilder();
        sb.append(title).append('\n');
        for (Object[] debug1 : debug) {
            for (Object item : debug1) {
                sb.append(item);
            }
            sb.append('\n');
        }
        return sb.toString();
    }
}

@@ -16,16 +16,64 @@
 epath;%0A%0A
+import java.util.Arrays;%0Aimport java.util.List;%0A
 import j
@@ -599,339 +599,1284 @@
 ing 
-fromDoubleArray(Object%5B%5D%5B%5D debug, String title) %7B%0A        StringBuilder sb = new StringBuilder();%0A        sb.append(title).append('%5Cn');%0A        for (Object%5B%5D debug1 : debug) %7B%0A            for (Object item : debug1) %7B%0A                sb.append(item);%0A            %7D%0A            sb.append('%5Cn');%0A        %7D%0A        return sb.toString(
+join(CharSequence delim, Object... args) %7B%0A        return join(delim, JoinAcceptor.ALL, args);%0A    %7D%0A%0A    @SafeVarargs%0A    public static %3CT%3E String join(CharSequence delim, JoinAcceptor%3CT%3E a, T... args) %7B%0A        delim = String.valueOf(delim);%0A        StringBuilder sb = new StringBuilder();%0A        for (T o : args) %7B%0A            if (!a.accept(o)) continue;%0A            sb.append(delim).append(String.valueOf(o));%0A        %7D%0A        return sb.substring(Math.min(delim.length(), sb.length()));%0A    %7D%0A%0A    public static String fromDoubleArray(Object%5B%5D%5B%5D debug, String title) %7B%0A        StringBuilder sb = new StringBuilder();%0A        sb.append(title).append('%5Cn');%0A        for (Object%5B%5D debug1 : debug) %7B%0A            for (Object item : debug1) %7B%0A                sb.append(item);%0A            %7D%0A            sb.append('%5Cn');%0A        %7D%0A        return sb.toString();%0A    %7D%0A%0A    public static List%3CString%3E argParse(String cmd) %7B%0A        if (cmd == null) return null;%0A        return Arrays.asList(cmd.split(%22 %22));%0A    %7D%0A%0A    public static interface JoinAcceptor%3CT%3E %7B%0A        public static JoinAcceptor ALL = new JoinAcceptor%3CObject%3E() %7B%0A            @Override%0A            public boolean accept(Object o) %7B%0A                return true;%0A            %7D%0A        %7D;%0A%0A        boolean accept(T t
 );%0A 

Implement common String utilities