code: public static String strip(String text)
     {
        String result = text;
        if (text != null && !text.isEmpty())
        {
           try
           {
              boolean formalRTF = isFormalRTF(text);
              StringTextConverter stc = new StringTextConverter();
              stc.convert(new RtfStringSource(text));
              result = stripExtraLineEnd(stc.getText(), formalRTF);
           }
           catch (IOException ex)
           {
              result = "";
           }
        }
  
        return result;
     }
docs: This method removes all RTF formatting from a given piece of text.
  
  @param text Text from which the RTF formatting is to be removed.
  @return Plain text