CSharp examples for System:String HTML
Convert New Lines To Html Line Breaks Preserve Space
public class Main{ public static string ConvertNewLinesToHtmlLineBreaksPreserveSpace(this string str) {//ww w . ja v a 2s . co m return str.Replace("\r\n", "<br/>") .Replace("\r", "<br/>") .Replace("\n", "<br/>") .Replace(" ", " "); } }