Cancel escape characters

  • Thread starter Thread starter Tim Mulholland
  • Start date Start date
T

Tim Mulholland

I am trying to parse a string of RTF pulled from the RTF property of a
textbox, going through it character by character

<example>

string s = textBox1.Rtf;
for (int iii = 0; iii < s.Length; iii++)
{
char c = s[iii];
DoSomething(c);
}
however, the RTF code contains a ton of backslash characters, and this
is causing them to be escaped when i'm going through each character. for
example... the RTF code starts off as "{\\rtf..."} and when i go through
it, i get the characters '{', '\', 'r' and so on, so the \\ is escaped.
How can i turn this off?
I know for a literal, i could use the @ symbol, but that seems to have
no effect here.

Thanks in advance!

Tim
 
Tim said:
I am trying to parse a string of RTF pulled from the RTF property of a
textbox, going through it character by character
example... the RTF code starts off as "{\\rtf..."} and when i go through
it, i get the characters '{', '\', 'r' and so on, so the \\ is escaped.
How can i turn this off?

The backslash char shows as "\\".
So you get what you have, nothing else.
What exactly are you trying to turn off? :)))

Vadim Chekan.
 
Hi Tim,

I think you may refer to Microsoft Office web component to find if this was
what you want.

Best regards,
Jeffrey Tan
Microsoft Online Partner Support
Get Secure! - www.microsoft.com/security
This posting is provided "as is" with no warranties and confers no rights.
 
Hi Tim,

If you want to get the non-escaped rtf text, you can replace the '\' with
'\\'.
If you have other concern, please feel free to let me know.

Best regards,
Jeffrey Tan
Microsoft Online Partner Support
Get Secure! - www.microsoft.com/security
This posting is provided "as is" with no warranties and confers no rights.
 
I was getting errors caused by some code that checked for escaped characters
and replaced them with other things - turns out i was mistaken on the RTF
spec, and thought that it really had two backslashes, not just one, all over
the place.

My apologies at wasting your time
 
Back
Top