How to create a text file(.txt) with word wrap property disable , from Visual Studio C#.net?
开发者_开发问答How to create a text file(.txt) with word wrap property disable , from Visual Studio C#.net?
Actually I am maintaining a log file with some values stored in tabular form, but the table contents exceeds the line limits and I want the table values shows in a single line.
Any way to do it?
Will appreciate your reply!
Regards
You are confusing the Word Wrap with strings in Notepad.. The string you add from C# in txt file is not wrapped.. it may be wrapped when seen in Notepad if WordWrap is on.
A string stored in txt file will never do any word wrap by itself.. (You dont have any word wrap char only \n for new line).
Word Wrap is a Feature of any Text Editor it has nothing to do with Actual String (Text). Here are excerpts from wikipedia on its meaning.
In text display, line wrap is the feature of continuing on a new line when a line is full, such that each line fits in the viewable window, allowing text to be read from top to bottom without any horizontal scrolling. Word wrap is the additional feature of most text editors, word processors, and web browsers, of breaking lines between and not within words, except when a single wordis longer than a line.
If you don't want to wrap Text disable it in the Editor (Like Notpad). You can't do any thing in the String(Text) itself (Other then adding
\n
after certain number of words if required).
精彩评论