"Talk / Say" functionality in a game
<p>So I've been racking my brain trying to figure out how to implement a "talk" function in my game. I'm new to C# programming but I've been doing as much reading and experimenting as I can with the language. </p>

<p>This is what I have so far:</p>

<pre><code>Comm comm = new Comm();
string message = null;
if (InputBox.Text == "say " + message)
            {
                OutputBox.AppendText(comm.do_say(message));
            }

class Comm
{
    public string do_say(string message)
    {
        return "You say: " + message + "\n";
    }
}
</code></pre>

<p>Now, this doesn't work. I think I know why, but I can't seem to figure out just how to redo it so it does work... I've tried to replace:</p>

<pre><code>(InputBox.Text == "say " + message)
</code></pre>

<p>with</p>

<pre><code>(InputBox.Text == "say {0}", message)
</code></pre>

<p>and it doesn't work either. So, now I'm out of ideas on how to make this work. I tried searching stackoverflow and google for answers but came up with nothing.</p>

<p>Any help or hints on how to fix it would be great!</p>

<p>Thanks.</p>
