C# Char from Int used as String - the real equivalent of VB Chr()
<p>I am trying to find a clear answer to my question and it is <strong>not</strong> a duplicate of any other questions on the site. I have read many posts and related questions on this on SO and several other sites. For example this one which is the key answer (many others are marked off as dulpicates and redirect to this one): <a href="https://stackoverflow.com/questions/721201/whats-the-equivalent-of-vbs-asc-and-chr-functions-in-c">What&#39;s the equivalent of VB&#39;s Asc() and Chr() functions in C#?</a></p>

<p>I was converting a VBA macro to C#. And in VBA <code>chr(7)</code> can simply be concatenated to a <code>string</code> as if <code>chr()</code> would yield a <code>string</code>. Why can't this be done in C#?</p>

<p>And unfortunately the answer is not clear and many times they state that this is a correct use:</p>

<pre><code>string mystring=(char)7;
</code></pre>

<p>Yet it gives me a compiler error as it does not evaluate as a string.</p>

<p>I had to use this to make it work:</p>

<pre><code>string mystring=((char)7).ToString();
</code></pre>

<p>This would be the equivalent of the VB Chr() function, really as Chr() in VB evaluates as a string.</p>

<p>My question is this: do I always need to cast the <code>char</code> over to <code>string</code> explicitly or there are some cases where it converts over implicitly?</p>

<p><strong>UPDATE:</strong></p>

<p>Per @Dirk's answer, this also works:</p>

<pre><code>string mystring = "" + (char)7;
</code></pre>

<p>This does not lessen my mystery. If concatenation works why there is no implicit cast??</p>

<p>I would like to get a full explanation on the difference between the VB Chr() and its equivalents in C#. I would appreciate any reference where I can read up on, or even examples would do. Thanks in advance.</p>