title: .NET replace non-printable ASCII with string representation of hex code
body: <p>I have a string with some non-printable ascii characters in it, something like:</p>
  
  <pre><code>"ABCD\x09\x05\r\n"
  </code></pre>
  
  <p>I want to replace these characters with a ascii string representation of the hex code numbers, so I get something like this:</p>
  
  <pre><code>"ABCD[09][05][0D][0A]"
  </code></pre>
  
  <p>Whats the best way to do this? Can a regex be used?</p>