1. I needed to replace the \r\n with actual carrige return and line
    feed and replace \t with actual tab.
    So I came up with the following:
        public string Transform(string data) 
        { 
            string result = data; 
            char cr = (char)13; 
            char lf = (char)10; 
            char tab = (char)9; 
     
            result = result.Replace("\\r", cr.ToString()); 
            result = result.Replace("\\n", lf.ToString()); 
            result = result.Replace("\\t", tab.ToString()); 
     
            return result; 
        } 
    The calling function:
    textOutput.Text = Transform("This is the first line.
    \\r\\n\\tThis is the second line.");
    0

    Add a comment

Blog Archive
Topics
Topics
Loading
Dynamic Views theme. Powered by Blogger. Report Abuse.