Click here to Skip to main content
15,885,985 members
Please Sign up or sign in to vote.
0.00/5 (No votes)
See more:
Hi,

C#
string c = dr["tasks"].ToString();
string h = c.Substring(0, 36);
string<pre> k = s.Substring(36, g);
string p= h + System.Environment.NewLine + k;

In the first step, I have a string c and I have divided it into two strings using "substring" keyword. In other step, I have inserted the new line.

Now, I want to remove the System.Environment.NewLine in the string p some where in the program, i.e (i cannot use the above strings like c,h,k any where). Right now I have only string p ; so I want to remove the newline from that string.

How can I do it?
Please give me an idea.
Posted
Updated 13-Aug-10 21:46pm
v3

1 solution

Use the Replace method :

p.Replace(System.Environment.NewLine,"")


Cheers
 
Share this answer
 

This content, along with any associated source code and files, is licensed under The Code Project Open License (CPOL)



CodeProject, 20 Bay Street, 11th Floor Toronto, Ontario, Canada M5J 2N8 +1 (416) 849-8900