Is there a maximum line-length in a textfile witho

2019-07-24 20:20发布

问题:

Trying to use StreamReader or similar from C# to read and write VERY LONG lines without the linebreak.

As I understand it, linebreak is still just 2 bytes (CR+LF) in a long bytearray called a file. At least thats how I am used to it in C/C++...

Is this the same for C# and .net or is there some maximum length for lines without a linebreak?

回答1:

There are no specific limitations in .NET, but different ways of viewing long lines may give you problems, mostly related to performance. Try to open your long line file in notepad with word wrap on and it will choke on you. The same with multiline textboxes in .NET.

But for pure programmatic reading very long lines is no problem.