Logo Questions Linux Laravel Mysql Ubuntu Git Menu
 

StreamWriter end line with Lf rather than CrLf

I'm using StreamWriter to output a text file, but I would like to end my WriteLine with Lf rather than the default CrLf. Is there an easy way to do this using a parameter built into StreamWriter?

I feel like quite a moron right now, but I'll leave the question up here just for laughs. It's been a long day...

like image 819
Alec Sanger Avatar asked Jan 31 '11 20:01

Alec Sanger


2 Answers

It comes with a NewLine property for just that.

like image 98
Matti Virkkunen Avatar answered Nov 18 '22 12:11

Matti Virkkunen


Just call .write and add the line break at the end?

like image 36
dotalchemy Avatar answered Nov 18 '22 12:11

dotalchemy