Saturday, May 20, 2006
An alternative to Environment.NewLine
Looking through my logs is always an interesting way to find out how people end up at my blog. One of the most searched for terms is 'Environment.NewLine alternative'. I'm not entirely sure why that would bring you here but anyway, what alternatives are there to Environment.NewLine? On Windows, Environment.NewLine is simply "\r\n", so you could use that, which would save a few key presses possibly (which is the only reason I can think of for wanting to find an alternative). If you're one of the brave people trying to develop a cross-platform app with Mono, then Environment.NewLine will be "\r" on Linux and other Unix platforms. So depending on what you're trying to achieve you may want to go with Environment.NewLine anyway or you may want to hardcode your newlines to "\r\n" or "\r".