if (o.trim().substring(0,dnpart.length()).equalsIgnoreCase(dnpart)) { part = o.trim().substring(dnpart.length()); break;
if (o.length() > dnpart.length()) { if (o.trim().substring(0,dnpart.length()).equalsIgnoreCase(dnpart)) { part = o.trim().substring(dnpart.length()); break; }
    public static String getPartFromDN(String dn, String dnpart) {        cat.debug(">getPartFromDN: dn:'" + dn+"', dnpart="+dnpart);        String trimmeddn = dn.trim();        String part = null, o = null;        dnpart += "="; // we search for 'CN=' etc.        StringTokenizer st = new StringTokenizer(trimmeddn, ",");        while (st.hasMoreTokens()) {            o = st.nextToken();            //cat.debug("checking: "+o.trim().substring(0,dnpart.length()));            if (o.trim().substring(0,dnpart.length()).equalsIgnoreCase(dnpart)) {                part = o.trim().substring(dnpart.length());                break;            }        }        cat.debug("<getpartFromDN: resulting DN part="+part);        return part;    } //getCNFromDN