How to convert this pice of code into C#
<p>// Decompress an LZW-encoded string</p>

<pre><code>function lzw_decode(s) {
    var dict = {};
    var data = (s + "").split("");
    var currChar = data[0];
    var oldPhrase = currChar;
    var out = [currChar];
    var code = 256;
    var phrase;
    for (var i=1; i&lt;data.length; i++) {
        var currCode = data[i].charCodeAt(0);
        if (currCode &lt; 256) {
            phrase = data[i];
        }
        else {
           phrase = dict[currCode] ? dict[currCode] : (oldPhrase + currChar);
        }
        out.push(phrase);
        currChar = phrase.charAt(0);
        dict[code] = oldPhrase + currChar;
        code++;
        oldPhrase = phrase;
    }
    return out.join("");
}
</code></pre>

<p>What will be equavalant to </p>

<p>data[i].charCodeAt(0);
out.push(phrase)
out.join("")</p>
