473,396 Members | 1,760 Online
Bytes | Software Development & Data Engineering Community
Post Job

Home Posts Topics Members FAQ

Join Bytes to post your question to a community of 473,396 software developers and data experts.

replacing carriage returns with HTML break tags

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
6 2024
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
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
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
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
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
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 thread has been closed and replies have been disabled. Please start a new discussion.

Similar topics

1
by: Porthos | last post by:
Hello all, Is there a facet pattern that will allow for the inclusion of a newline or carriage return to occur within a tag? From the W3C schema document and from previous posts I've read that ...
2
by: Jerome | last post by:
Hi, I know this is an old question but I don't find the solution on the 'net ... The user enters his data into a multiline textarea field. The data is saved in a TEXT field in a database on a...
7
by: Rob Meade | last post by:
Hi all, Been a long time since I've been here... /me waves to all.. Ok - my conundrum.. I have a form where a user can enter text and BB codes...for example:
8
by: Steven | last post by:
i need to force a carriage return with a textarea field at X number of characters. anybody know how to do this? tks
4
by: Les Juby | last post by:
Can someone please help with a suggestion as to how I can keep the formatting (carriage returns) that the user enters into a memo field and then display that later. I figured I might be able to...
2
by: Matt Mercer | last post by:
Hi all, I am having a frustration problem, and I have read about 25 newsgroup postings that do not have a satisfying answer :) The problem appears to be common where carriage returns are lost...
8
by: TheDude5B | last post by:
Hi, I have some data which is stored in my MySQL database as TEXT. when the data is entered in, it has some carriage returns in it, and this can be seen when querying the data using MySQL Query...
4
by: Tony Girgenti | last post by:
Hello. When i look at a web form in design view, i have the option to view the HTML. Some of the HTML code is in one long string and hard to read. Is it OK to put in carriage returns and...
1
by: jonnyboy6969 | last post by:
Hi All Really hoping someone can help me out here with my deficient regex skills :) I have a function which takes a string of HTML and replaces a term (word or phrase) with a link. The pupose...
0
by: Charles Arthur | last post by:
How do i turn on java script on a villaon, callus and itel keypad mobile phone
0
BarryA
by: BarryA | last post by:
What are the essential steps and strategies outlined in the Data Structures and Algorithms (DSA) roadmap for aspiring data scientists? How can individuals effectively utilize this roadmap to progress...
1
by: nemocccc | last post by:
hello, everyone, I want to develop a software for my android phone for daily needs, any suggestions?
0
by: Hystou | last post by:
There are some requirements for setting up RAID: 1. The motherboard and BIOS support RAID configuration. 2. The motherboard has 2 or more available SATA protocol SSD/HDD slots (including MSATA, M.2...
0
marktang
by: marktang | last post by:
ONU (Optical Network Unit) is one of the key components for providing high-speed Internet services. Its primary function is to act as an endpoint device located at the user's premises. However,...
0
by: Hystou | last post by:
Most computers default to English, but sometimes we require a different language, especially when relocating. Forgot to request a specific language before your computer shipped? No problem! You can...
0
by: Hystou | last post by:
Overview: Windows 11 and 10 have less user interface control over operating system update behaviour than previous versions of Windows. In Windows 11 and 10, there is no way to turn off the Windows...
0
tracyyun
by: tracyyun | last post by:
Dear forum friends, With the development of smart home technology, a variety of wireless communication protocols have appeared on the market, such as Zigbee, Z-Wave, Wi-Fi, Bluetooth, etc. Each...
0
agi2029
by: agi2029 | last post by:
Let's talk about the concept of autonomous AI software engineers and no-code agents. These AIs are designed to manage the entire lifecycle of a software development project—planning, coding, testing,...

By using Bytes.com and it's services, you agree to our Privacy Policy and Terms of Use.

To disable or enable advertisements and analytics tracking please visit the manage ads & tracking page.