code: public static String removeControlCharacters(String s, boolean removeCR)
      {
          String ret = s;
          if(ret != null)
          {
              ret = ret.replaceAll("_x000D_","");
              if(removeCR)
                  ret = ret.replaceAll("\r","");
          }
          return ret;
      }
docs: Remove any extraneous control characters from text fields.
  @param s The string to have control characters removed
  @param removeCR <CODE>true</CODE> if carriage returns should be removed
  @return The given string with all control characters removed