Formatting string with end of line

A

alfred

Hi everyone, I have a problem. I have create a string (its name is
book) and i want to insert the books with this text formatting:
First book
Second book
third book
ecc....

with the end of line at the end of the string so if i want to write
into a file XML this is the style that i want to do. In my program the
XML is:
First book Second book third
book ecc....

How can i do this?

Thank you
 
G

Guest

Hi everyone, I have a problem. I have create a string (its name is
book) and i want to insert the books with this text formatting:
First book
Second book
third book
ecc....

with the end of line at the end of the string so if i want to write
into a file XML this is the style that i want to do. In my program the
XML is:
First book Second book third
book ecc....

How can i do this?

Thank you

you need to insert carriage return line feed into string.

If you use VB you can use this constant: vbCrLf

"First book" & vbCrLf & "Second book"....

If you use C#: "\n\r"

"First book" + "\n\r" + "Second book"....
 
?

=?ISO-8859-1?Q?G=F6ran_Andersson?=

Alexey said:
you need to insert carriage return line feed into string.

If you use VB you can use this constant: vbCrLf

"First book" & vbCrLf & "Second book"....

Use the value in Environment.NewLine. That is programming language
independent and system independent.

"First book" & Environment.NewLine & "Second book"
If you use C#: "\n\r"

That is a line feed and a carrege return. It should be "\r\n". That is
wnat Environment.NewLine contains for an non-unix system. But
Evironment.Newline works for any system.
 
G

Guest

Use the value in Environment.NewLine. That is programming language
independent and system independent.

you're right, do \r\n instead

regarding Environment.NewLine: I don't see any sense to be language
independent in his case. And in general, using Environment.NewLine in
ASP.net could be the cause of problems with different kind of clients
as it represents a server value.
 
?

=?ISO-8859-1?Q?G=F6ran_Andersson?=

Alexey said:
you're right, do \r\n instead

regarding Environment.NewLine: I don't see any sense to be language
independent in his case. And in general, using Environment.NewLine in
ASP.net could be the cause of problems with different kind of clients
as it represents a server value.

Yes, you are right, Environment.NewLine represents a line break on the
server system, so that might not always be what's desired.

On the other hand, there isn't really anything in this question (besides
where it's posted) that suggests that it has anything to do with the web
at all.
 

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

Members online

Forum statistics

Threads
474,240
Messages
2,571,205
Members
47,843
Latest member
eicamotu

Latest Threads

Top