C# method to add newline or Br to string after n charectors

enter value to split and delimitter to split

public string splitString(string value, int Count)
{
int result = 0;
string new_value = “”;
foreach (char c in value)
{
result++;
new_value += c.ToString();
if (result == Count)
{
new_value += “
“;
result = 0;
}
}
return new_value;
}

Advertisements

About kakani santosh kumar

Working as Software Engineer in Prithvi Information Solutions having 3 years of Experience in Dotnet Framework ranging from 1.1 to 3.5
This entry was posted in Uncategorized and tagged . Bookmark the permalink.

Leave a Reply

Fill in your details below or click an icon to log in:

WordPress.com Logo

You are commenting using your WordPress.com account. Log Out / Change )

Twitter picture

You are commenting using your Twitter account. Log Out / Change )

Facebook photo

You are commenting using your Facebook account. Log Out / Change )

Google+ photo

You are commenting using your Google+ account. Log Out / Change )

Connecting to %s