title: Hex Converter ArgumentOutOfRangeException
body: <p>My Hex Converter is working fine when converting valid hex but its giving me an <code>ArgumentOutOfRangeException</code> error when converting invalid hex and I don't know how to handle this exception. </p>
  
  <p>My Code:</p>
  
  <pre><code>public string DecryptHex(ref string Data)
  {
      string Data1 = "";
      string inData = "";
      while (Data.Length &gt; 0)
      {
          Data1 = System.Convert.ToChar(System.Convert.ToUInt32(Data.Substring(0, 2), 16)).ToString();
          inData = inData + Data1;
          Data = Data.Substring(2, Data.Length - 2);
      }
      return inData;
  }
  </code></pre>