code_junkie

C# functions with static data

Nov 11th, 2011
85
0
Never
Not a member of Pastebin yet? Sign Up, it unlocks many cool features!
text 0.30 KB | None | 0 0
  1. Function EncodeForXml(ByVal data As String) As String
  2. Static badAmpersand As Regex = new Regex("&(?![a-zA-Z]{2,6};|#[0-9]{2,4};)")
  3.  
  4. data = badAmpersand.Replace(data, "&")
  5.  
  6. ''// more processing
  7.  
  8. return data
  9. End Function
  10.  
  11. private static readonly RegEx badAmpersand = new RegEx("...");
Add Comment
Please, Sign In to add comment