XML : How do I remove ALL trailing whitespaces from ALL XML Node values using C#?

I am trying to write a generalized C# .NET code to check every XML node's value in a XML file for trailing whitespaces and remove them. I tried the PreserveWhiteSpace. But that did not work. Please advise.

  <Sample>  <Item>  <Value>BatchID             </Value>  <Details>RecipeID              </Details>  </Item>  <Summary>Test data</Summary>  </Sample>    

No comments:

Post a Comment