没有换行符的文本文件中是否有最大行长? [英] Is there a maximum line-length in a textfile without a linebreak?

查看:101
本文介绍了没有换行符的文本文件中是否有最大行长?的处理方法,对大家解决问题具有一定的参考价值,需要的朋友们下面随着小编来一起学习吧!

问题描述

尝试使用C#中的StreamReader或类似工具读取和写入非常长的行而没有换行符.

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

据我了解,在称为文件的长字节数组中,换行符仍仅为2个字节(CR + LF).至少这就是我在C/C ++中习惯的方式...

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

C#和.net是否相同?或者没有换行符的行是否有一些最大长度?

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

推荐答案

.NET中没有特定限制,但是查看长行的不同方法可能会给您带来问题,主要与性能有关.尝试在记事本上打开自动换行功能,打开长行文件,这样会令您窒息. .NET中的多行文本框也是如此.

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.

这篇关于没有换行符的文本文件中是否有最大行长?的文章就介绍到这了,希望我们推荐的答案对大家有所帮助,也希望大家多多支持IT屋!

查看全文
登录 关闭
扫码关注1秒登录
发送“验证码”获取 | 15天全站免登陆