Escape XML Function



private string EscapeXml (string input) {
  string output = string.Empty;

  output = input.Replace("&", "&");
  output = output.Replace("'", "'");
  output = output.Replace("\"", """);
  output = output.Replace(">", ">");
  output = output.Replace("<", "<");
  return output;
}

Tagged with:
Posted in C#

Leave a Reply

Fill in your details below or click an icon to log in:

WordPress.com Logo

You are commenting using your WordPress.com account. Log Out /  Change )

Twitter picture

You are commenting using your Twitter account. Log Out /  Change )

Facebook photo

You are commenting using your Facebook account. Log Out /  Change )

Connecting to %s

Antek Group Blog
Categories
%d bloggers like this: