Tek-Tips is the largest IT community on the Internet today!

Members share and learn making Tek-Tips Forums the best source of peer-reviewed technical information on the Internet!

  • Congratulations Chriss Miller on being selected by the Tek-Tips community for having the most helpful posts in the forums last week. Way to Go!

Reading from .rtf file - and replacing strings.... ?

Status
Not open for further replies.

StevenK

Programmer
Jan 5, 2001
1,294
GB
I have a couple of '.rtf' files that I have some placeholders in (let's suppose that they're strings 'PlaceHolder1', 'PlaceHolder2', etc.).
I want to be able to load up these files into code (using a StreamReader ?) and then search through the text and replace 'PlaceHolder1', 'PlaceHolder2', etc.with replacement strings.
How would I start working at this ?

Thanks in advance
Steve
 
RichTextBox richTextBox1=new richTextBox1();
richTextBox1.LoadFile("myfile.rtf", RichTextBoxStreamType.RichText);
string txt = richTextBox1.Rtf;
Now, use Find(), Replace() or Regex.
obislavu
 
Status
Not open for further replies.

Part and Inventory Search

Sponsor

Back
Top