Thursday, 21 January 2016

XML : \r\n returns while storing values in XML

I am tring to make a simple XML from a string. It works perfectly fine, but \r\n gets added in between.

What change should I do ?

     String doubleQuote = @"";       String backSlash = @"\";        XElement xmlInReturn = new XElement("toast",          new XAttribute("activationType", backSlash + doubleQuote + "abc" + backSlash + doubleQuote),                          new XElement("def",           new XElement("ghi",              new XAttribute("jkl", "mno"),              new XElement("pqr", headerText),              new XElement("stu", BodyContents)                )));    

Here, \r\n gets added when I retrieve xmlInReturn.

No comments:

Post a Comment