divinediu
divinediu

Reputation: 433

New Line in StringWriter

I need a new line in my StringWriter. It is just not happening. Please help.

    stringWrite.WriteLine(Header);
    stringWrite.Write("\n ========================================================");

Header is a string.

I tried stringWrite.WriteLine. That isn't working either.

enter image description here

Upvotes: 0

Views: 5187

Answers (2)

Dan
Dan

Reputation: 754

In this case, since you're writing to PDF files, they require the use of the <br> tags (line break in html) instead of the normal \n format for new lines.

Upvotes: 1

Gusman
Gusman

Reputation: 15151

You are missing \r, in Windows a newline is composded of carriage return (\r) and new line (\n) so to create a newline you must add \r\n

Upvotes: 1

Related Questions