Then let me explain it for them line wrap means In text display, it is the feature of continuing on a new line when a line is full, such that each line fits in the viewable window.
I have written a sample code that will print only 10 letters in each line. You can set your own size limit by changing the value of variable "size".
using System;
using System.Collections.Generic;
using
System.Linq;
using
System.Text;
using
System.Messaging;
using
System.Data;
using
System.Threading;
namespace
ConsoleApplication2
{
class Program
static void
Main(string[] args)
{
string s =
"Programmer's Fav test string is Hello World";
int size = 10;
int i = Convert.ToInt32(Math.Ceiling(s.Length
/ size + .5));
if (s.Length > size)
{
for (int j = 1;
j <= i; j++)
{
if (((j - 1) * size + size) < s.Length)
{
final
= s.Substring((j * size) - size, size);
}
else
{
final
= s.Substring((j * size) - size, s.Length - ((j * size) - size));
}
sbd.Append(final + "\n");
Console.WriteLine(sbd.ToString());
}
else
{
Console.WriteLine(s);
}
Console.Read();
}
}
}

Vinay SinghPosted Jun 3, 2016, 7:19 AM
Nice article. Have a look of this article to perform write operation in text file.http://www.aspdotnet-pools.com/2016/06/write-new-line-text-in-text-filetxt-in.html