Is there a maximum line-length in a textfile without a linebreak?

北战南征 提交于 2019-12-24 07:38:38

问题


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.



来源:https://stackoverflow.com/questions/7706170/is-there-a-maximum-line-length-in-a-textfile-without-a-linebreak

易学教程内所有资源均来自网络或用户发布的内容,如有违反法律规定的内容欢迎反馈
该文章没有解决你所遇到的问题?点击提问,说说你的问题,让更多的人一起探讨吧!