New Line in a string builder

G

Guest

I am appending text to a string builder object.
Nothing seems to add a new line to the text .
I have used vbNewLine, vbCRLF, appendline.
What is the right way to inject a new line in a stringbuilder object
 
D

Daniel Walzenbach

environment.newline?

where do you want to display the string?

Regards

Daniel Walzenbach
 
G

Guest

Hi P K,

The vbNewLine should work. The only thing I can think of is if you are
spitting the string out into the browser, the line breaks aren't going to
show up, try "<br>" instead.

If you really aren't getting line breaks, use the StringWriter class:
Dim writer as New StringWriter()
writer.WriteLine("Line 1")
writer.WriteLine("Line 2")
writer.WriteLine("Line 3")

writer.ToString()
outputs:
Line 1
Line 2
Line 3


Tim
 
G

Guest

yep, the browser doesn't seem to understand vbNewLine or vbcrlf etc.
br just worked fine.
Thanks
 

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,260
Messages
2,571,038
Members
48,768
Latest member
first4landlord

Latest Threads

Top