replacing carriage returns with HTML break tags

  • Thread starter Thread starter Guest
  • Start date Start date
G

Guest

I'm changing our order confimation from a plain text to HTML. The original
setup of this had carriage returns between line items. These are not
interpreted by HTML so all the line items run together.

Here is the code that produces the body of the message.

msg.Body = string.Format(body, values);
return msg;

Is there a method of Format to allow this kind of search and replace or
would I need to add a step to evaluate the values and replace them before
commiting them to msg.Body?
 
Hmm...

based on the code that I'm working can I use the Replace method with Format
method or will I need to do this seperately?

Bear in mind that the MSDN .Net documentation is nothing but gibberish to me.
Sorry
 
Hi,

use String.Replace( searchString, replacementString)


cheers,
 
Hi,

What is the reason for format?

If the only reason is your problem then IOM it's easier to use Replace as
shown. Otherwise you could do this:

msg.Body = string.Format(body, values).Replace( XXX, YYY );


cheers,
 

Ask a Question

Want to reply to this thread or ask your own question?

You'll need to choose a username for the site, which only take a couple of moments. After that, you can post your question and our members will help you out.

Ask a Question

Back
Top