Linebreaks in CodeSmith

keywords: linebreaks; line breaks; carriage returns; CodeSmith

This may not seem blog-worthy to non-CodeSmiths out there, nor to Seasoned CodeSmiths either.  But it took me a bit of time to track this down, so being the generous guy I am with top secret inside info, here ya go.

There are at least two ways to create linebreaks in your generated code.  In CSharp that would be “\r\n”.  It is NOT “\n,” the norm in C# and the reason I had to investigate the matter.  You can also use Environment.NewLine.  In VB, you use the standard vbCrlf (or Environment.NewLine) for linebreaks.

Article written by

A long time developer, I was an early adopter of Linux in the mid-90's for a few years until I entered corporate environments and worked with Microsoft technologies like ASP, then .NET. In 2008 I released Sueetie, an Online Community Platform built in .NET. In late 2012 I returned to my Linux roots and locked in on Java development. Much of my work is available on GitHub.