public final String[] split(String s, char delim) {
        boolean inQuotes = false;
        StringBuilder sb = new StringBuilder();
        for (char c : s.toCharArray()) {
            if (inQuotes) {
                if (c == '"') {
                    inQuotes = false;
                } else {
                    sb.append(c);
                }
            } else {
                if (c == '"') {
                    inQuotes = true;
                } else if (c == delim) {
                    sb.append('*');
                } else {
                    sb.append(c);
                }
            }
        }
        return sb.toString().split("\\*+");
    }