code: private String removeSpacesInDN(String DN) {
          String attrs[] = DN.split(",");
          StringBuilder result = new StringBuilder();
          for (int i = 0; i < attrs.length; i++) {
              if (attrs[i].indexOf("=") >= 0)
                  result.append(attrs[i].trim());
              else
                  result.append(attrs[i]);
              if (i != (attrs.length - 1))
                  result.append(",");
          }
          return result.toString();
      }
docs: PM76997