title: How to convert a text file having a hexadecimal code sequence into a byte array?
body: <p>So I was wondering if there any possibility to read a plain text bytes sequence in hexadecimal from a text file?</p>
  <p><strong>The Bytes Are Saved On to A Text File in Text Format</strong></p>
  <p>e.g. :</p>
  <pre><code>string text = 
    @&quot;0x4D, 0x5A, 0x90, 0x00, 0x03, 0x00, 0x00, 0x00, 0x04, 0x00, 0x00, 0x00,
      0xFF, 0xFF, 0x00, 0x00, 0xB8, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00&quot;;
  </code></pre>
  <p>Here I <em>don't mean</em> <code>File.ReadAllBytes(filename)</code></p>
  <p>What I tried is reading the text file with <code>File.ReadAllText(filename)</code> but sadly thats in a string <code>Format</code> not in the <code>byte</code> format...</p>
  <p>We need to convert these <em>text sequence</em> to a <code>byte</code> array.</p>
  <p>These text sequence are actual bytes stored in a text file.</p>
  <p>Thanks in Advance..</p>