Not a member of Pastebin yet?
Sign Up,
it unlocks many cool features!
- 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";
- }
- }
- (InputBox.Text == "say " + message)
- (InputBox.Text == "say {0}", message)
- if(InputBox.Text.StartsWith("Say "))
- OutputBox.Text += InputBox.Text.SubString(4);
- if (InputBox.Text == "say " + message)
- Match m = Regex.Match(InputBox.Text, @"^says+(.*)$", RegexOptions.IgnoreCase);
- if (m.Success)
- {
- OutputBox.AppendText(Comm.GetScreenoutput(m.Groups[1].Value));
- }
- static class Comm
- {
- public static string GetScreenOutput(string message)
- {
- return "You say: " + message + "n";
- }
- }
- if (InputBox.Text.ToUpper().StartsWith("SAY "))
- {
- OutputBox.AppendText(comm.do_say(message));
- }
Add Comment
Please, Sign In to add comment