Replacing HTML charcters with entity equivalents

  • Thread starter Thread starter iGadget
  • Start date Start date
I

iGadget

Hi,
Is anyone aware of a built-in method to substitute HTML or XML reserved
characters with their escaped equivalents?
If I have the String "If X < Y then hello" I have to substitute the '<' in
order to encode it into a serialized XML string.
What is the 'correct' way in .NET?

Cheers,
iGadget
 
Back
Top