public static String remove(String s, String remove, String delimiter) {
        if ((s == null) || (remove == null) || (delimiter == null)) {
            return null;
        }

        if (!CommonUtil.isNullOrEmpty(s) && !s.endsWith(delimiter)) {
            s += delimiter;
        }

        while (contains(s, remove, delimiter)) {
            int pos = s.indexOf(delimiter + remove + delimiter);

            if (pos == -1) {
                if (s.startsWith(remove + delimiter)) {
                    s = s.substring(remove.length() + delimiter.length(), s.length());
                }
            } else {
                s = s.substring(0, pos)
                    + s.substring(pos + remove.length() + delimiter.length(), s.length());
            }
        }

        return s;
    }