title: c# decimal to hex & hex to decimal / hex to ascii in LINQ
body: <p>I'm trying to do some conversion and would like to use Linq to achieve the following,</p>
  
  <p>Decimal to Hex,
  Decimal to Ascii,
  Hex to Decimal,
  Hex to Ascii</p>
  
  <p>Can someone please show me how to do this efficently in Linq?
  I'll be displaying the output into textboxes.</p>
  
  <p>Also, I have a prefix and delimiter field that will also need to be included,</p>
  
  <p>Example: </p>
  
  <pre><code>string input = txtAscii.Text;
  string delim = txtDelimiter.Text;
  string prefix = txtPrefix.Text;
  if (checkBox1.Checked == true &amp;&amp; string.IsNullOrEmpty(delim)) delim = " ";
  //Linq, Ascii to Decimal.    
  txtDecimal.Text = string.Join(delim, input.Select(c =&gt; prefix + ((int)c).ToString()));
  </code></pre>
  
  <p>Thanks all.</p>