By using this site, you agree to our updated Privacy Policy and our Terms of Use. Manage your Cookies Settings.
457,967 Members | 1,236 Online
Bytes IT Community
+ Ask a Question
Need help? Post your question and get tips & solutions from a community of 457,967 IT Pros & Developers. It's quick & easy.

replacing carriage returns with HTML break tags

P: n/a
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?
Nov 17 '05 #1
Share this Question
Share on Google+
6 Replies


P: n/a
stb
please check

http://msdn.microsoft.com/library/de...placetopic.asp

"Tbone" wrote:
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?

Nov 17 '05 #2

P: n/a
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

"stb" wrote:
please check

http://msdn.microsoft.com/library/de...placetopic.asp

"Tbone" wrote:
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?

Nov 17 '05 #3

P: n/a
Hi,

use String.Replace( searchString, replacementString)
cheers,

--
Ignacio Machin,
ignacio.machin AT dot.state.fl.us
Florida Department Of Transportation

"Tbone" <tb***@community.nospam> wrote in message
news:CD**********************************@microsof t.com...
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?

Nov 17 '05 #4

P: n/a
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,

--
Ignacio Machin,
ignacio.machin AT dot.state.fl.us
Florida Department Of Transportation

"Tbone" <tb***@community.nospam> wrote in message
news:C1**********************************@microsof t.com...
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

"stb" wrote:
please check

http://msdn.microsoft.com/library/de...placetopic.asp

"Tbone" wrote:
> 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?

Nov 17 '05 #5

P: n/a
I don't get an option via intellisense to use String.Replace.

"Ignacio Machin ( .NET/ C# MVP )" wrote:
Hi,

use String.Replace( searchString, replacementString)
cheers,

--
Ignacio Machin,
ignacio.machin AT dot.state.fl.us
Florida Department Of Transportation

"Tbone" <tb***@community.nospam> wrote in message
news:CD**********************************@microsof t.com...
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?


Nov 17 '05 #6

P: n/a
Tbone <tb***@community.nospam> wrote:
I don't get an option via intellisense to use String.Replace.


It's an instance method - you call it on an instance of string, you
don't just type String.Replace itself.

See the docs for String.Replace for more information.

--
Jon Skeet - <sk***@pobox.com>
http://www.pobox.com/~skeet
If replying to the group, please do not mail me too
Nov 17 '05 #7

This discussion thread is closed

Replies have been disabled for this discussion.