Saturday, 10 March 2012

Best ways to add a new line in to C# strings in Visual Webpart

There are a couple options to add new line in a strin using with C# programming language,

These C# programs use the Environment.NewLine property. NewLine equals \r\n.
String = st;
st="your account has been created successfully" + "<br />" + "Temporary pasword will be sent your email";
st=st.Replace("<br />", System.Environment.NewLine);

Using with '\r\n'  :
string=st;
st="your account has been created successfully" + "\r\n" + "Temporary pasword will be sent your email";

No comments:

Post a Comment