26

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...

David Gardiner
  • 16,892
  • 20
  • 80
  • 117
Alec Sanger
  • 4,442
  • 1
  • 33
  • 53

2 Answers2

39

It comes with a NewLine property for just that.

Matti Virkkunen
  • 63,558
  • 9
  • 127
  • 159
4

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

dotalchemy
  • 2,459
  • 19
  • 24