Logo Questions Linux Laravel Mysql Ubuntu Git Menu
 

When I use StringBuilder.Append instead of .AppendLine, do I need to add additional .Append(crlf)s?

I'm adapting some code I found here: http://nicholas.piasecki.name/blog/2009/03/sending-raw-epl2-directly-to-a-zebra-lp2844-via-c/#comment-1636, but in VS 2003 / .NET 1.1, StringBuilder's AppendLine method is not recognized, so I truncated it to .Append.

Will I need now to add #13#10 or so after each call to Append - I'm assuming that is something AppendLine does automatically.

like image 613
B. Clay Shannon-B. Crow Raven Avatar asked Dec 06 '22 09:12

B. Clay Shannon-B. Crow Raven


1 Answers

Yes.

AppendLine() will append its argument, followed by Environment.Newline.
If you don't call AppendLine(), you will need to include the newline yourself.

like image 131
SLaks Avatar answered Jan 23 '23 06:01

SLaks