Net does indeed have built-in ways of doing this. Update The first few responses indicate that. Net 2.0 where I work, but if someone could take the final product and turn it into an extension method for the string class, that’d be pretty cool too. Sorry for all you C# -only folks– I don’t really care which language I use, but I wanted to make the Regex static and you can’t do that in C# without declaring it outside the method, so this will be VB.Netįinally, we’re still on. The data I’m using that prompted this whole thing could contain bad characters like &, ", "gt ") So, before I go too much further, could I just be missing the built-in function?Īssuming for a moment that it really doesn’t exist, I’m putting together my own generic EncodeForXml(string data) method, and I’m thinking about the best way to do this. Net to encode a string for use in an Xml element or attribute, and was surprised when I didn’t immediately find one.
0 Comments
Leave a Reply. |