Click here to Skip to main content
15,886,689 members
Home / Discussions / C#
   

C#

 
GeneralRe: word automatic rotation Pin
kskumaran10-Feb-14 1:07
kskumaran10-Feb-14 1:07 
AnswerRe: word automatic rotation PinPopular
Chris Quinn9-Feb-14 23:28
Chris Quinn9-Feb-14 23:28 
GeneralRe: word automatic rotation Pin
Bernhard Hiller10-Feb-14 21:29
Bernhard Hiller10-Feb-14 21:29 
Questionsending sms Pin
sadish69-Feb-14 20:02
sadish69-Feb-14 20:02 
SuggestionRe: sending sms Pin
Richard MacCutchan9-Feb-14 22:38
mveRichard MacCutchan9-Feb-14 22:38 
Questioncode to generate text from the given string and how to detect "\" in the text as a text and not as a tag during parsing of rtf file Pin
aayush saraswat9-Feb-14 6:54
aayush saraswat9-Feb-14 6:54 
AnswerRe: code to generate text from the given string and how to detect "\" in the text as a text and not as a tag during parsing of rtf file Pin
Mycroft Holmes9-Feb-14 11:58
professionalMycroft Holmes9-Feb-14 11:58 
AnswerRe: code to generate text from the given string and how to detect "\" in the text as a text and not as a tag during parsing of rtf file Pin
BillWoodruff9-Feb-14 19:03
professionalBillWoodruff9-Feb-14 19:03 
The simplest solution is to just use a RichTextBox: add your RTF string to it; and, read back its 'Text Property:
C#
YourRichTextBox.Rtf = YourRTFString;

string YourPlainText = YourRichTextBox.Text;
Or, you could use this:
C#
// in Form scope 
private char[] cleanRTF = new char[] {'\\', ' ', '{', '}', '\r', '\n'};

// in a Method
string[] sAry = str.Split(cleanRTF, StringSplitOptions.RemoveEmptyEntries);
But, then, you've got to do something with the resulting string[], like combining it back into a continuous string, in which case you will still have lots of the RTF formatting codes.

For more sophisticated "cleaning" you should consider using a RegEx; but even that is not easy, as you can read about here: [^].
“But I don't want to go among mad people,” Alice remarked.

“Oh, you can't help that,” said the Cat: “we're all mad here. I'm mad. You're mad.”

“How do you know I'm mad?” said Alice.

“You must be," said the Cat, or you wouldn't have come here.” Lewis Carroll

AnswerRe: code to generate text from the given string and how to detect "\" in the text as a text and not as a tag during parsing of rtf file Pin
Richard Deeming10-Feb-14 1:41
mveRichard Deeming10-Feb-14 1:41 
QuestionDisable combo box on selecting an option. Pin
Mohan Subramani9-Feb-14 3:40
Mohan Subramani9-Feb-14 3:40 
AnswerRe: Disable combo box on selecting an option. Pin
OriginalGriff9-Feb-14 3:47
mveOriginalGriff9-Feb-14 3:47 
AnswerRe: Disable combo box on selecting an option. Pin
BillWoodruff9-Feb-14 6:18
professionalBillWoodruff9-Feb-14 6:18 
Questionvideo and gps Pin
jas168-Feb-14 23:21
jas168-Feb-14 23:21 
AnswerRe: video and gps Pin
Ravi Bhavnani9-Feb-14 4:34
professionalRavi Bhavnani9-Feb-14 4:34 
QuestionGetting Data From User Pin
RebornProgrammer8-Feb-14 21:00
RebornProgrammer8-Feb-14 21:00 
AnswerRe: Getting Data From User Pin
OriginalGriff8-Feb-14 23:21
mveOriginalGriff8-Feb-14 23:21 
QuestionWrite to notepad or other windows Pin
alirezamansoori8-Feb-14 19:27
alirezamansoori8-Feb-14 19:27 
AnswerRe: Write to notepad or other windows Pin
OriginalGriff8-Feb-14 19:58
mveOriginalGriff8-Feb-14 19:58 
QuestionHow to Fetch UserName & Current Date automatically. Pin
Mohan Subramani8-Feb-14 7:01
Mohan Subramani8-Feb-14 7:01 
AnswerRe: How to Fetch UserName & Current Date automatically. Pin
OriginalGriff8-Feb-14 7:32
mveOriginalGriff8-Feb-14 7:32 
AnswerRe: How to Fetch UserName & Current Date automatically. Pin
Dave Kreskowiak8-Feb-14 9:22
mveDave Kreskowiak8-Feb-14 9:22 
AnswerRe: How to Fetch UserName & Current Date automatically. Pin
Mycroft Holmes8-Feb-14 13:35
professionalMycroft Holmes8-Feb-14 13:35 
AnswerRe: How to Fetch UserName & Current Date automatically. Pin
Richard Deeming10-Feb-14 1:37
mveRichard Deeming10-Feb-14 1:37 
Questionhow can i get min value in datatable with distinct items using loops Pin
yahiaalaa8-Feb-14 5:49
yahiaalaa8-Feb-14 5:49 
AnswerRe: how can i get min value in datatable with distinct items using loops Pin
TnTinMn8-Feb-14 6:54
TnTinMn8-Feb-14 6:54 

General General    News News    Suggestion Suggestion    Question Question    Bug Bug    Answer Answer    Joke Joke    Praise Praise    Rant Rant    Admin Admin   

Use Ctrl+Left/Right to switch messages, Ctrl+Up/Down to switch threads, Ctrl+Shift+Left/Right to switch pages.