I need only the text from a TextEntity txt.RichText;


I Need the Plaintext from this Richtext there is a better way:

public static string Richtext_to_string(TextEntity text)
            string[] stringSeparators = new string[] { "i " };
            string[] result;

            string str;
            str = text.RichText;
            result = str.Split(stringSeparators, StringSplitOptions.None);

            string[] stringSeparators2 = new string[] { "}" };
            result = result[1].Split(stringSeparators2, StringSplitOptions.None);

            string rc = result[0];

            return rc;

Richtext Looks like “{\rtf1\deff0{\fonttbl{\f0 Arial;}}\fs40\b\i{\f0\b\i A103}\par}” and I want A100
Thanks Robert

Hi @Robert,

Rather than this:

str = text.RichText;

how about this?

str = text.PlainText;

– Dale