Replace special character from a string and pass to xml

  • Thread starter Thread starter Dan2890
  • Start date Start date
D

Dan2890

Guest
Hi, I am receiving a special character like '&' in my string which is being passed to xml and it is failing.

sting a = "Tom & Jerry"

How easily can i remove this & with & and pass to the xml ?

Please advice


if(a.Contains("'@' || '#' || '$' || '&' || '%' || '!' || '~'"))
{
a= a.Replace("&");


return a;

}


RH

Continue reading...
 
Back
Top