title: How to remove null character (zero character) from string
body: <p>I been trying to remove all the zero characters from my string</p>
  
  <p>My string is made from these hexadecimal bytes</p>
  
  <blockquote>
    <p>00 44 00 65 00 6C 00 70 00 68 00 69</p>
  </blockquote>
  
  <p>For every letter there is a Zero byte (null byte) in front of it.. I was guessing I had to use some kind of Unicode encoding or wide encoding to get the text without those zero's.</p>
  
  <p>But I couldn't figure it out so I figured best way is to use a Replace but even that fails.</p>
  
  <pre><code>Dim packet() As String = {&amp;H0, &amp;H44, &amp;H0, &amp;H65, &amp;H0, &amp;H6C, &amp;H0, &amp;H70, &amp;H0, &amp;H68, &amp;H0, &amp;H69}
  Dim str As String = Encoding.ASCII.GetString(packet, 0, 12)
  str = str.Replace("\0", "")  'Compiles and fails
  str = str.Replace(\0, "")  'No compile
  str = str.Replace('\0', "")  'No compile
  </code></pre>