Convert RTF data to unmarked up string

1
2
3
4
5
6
7
8
static public string ConvertToText(string rtf)
{
   using(RichTextBox rtb = new RichTextBox())
   {
       rtb.Rtf = rtf;
       return rtb.Text;
   }
}

Catch ArgumentException for cases where the data isnt RTF

//