Guest User

Untitled

a guest
Jan 17th, 2019
97
0
Never
Not a member of Pastebin yet? Sign Up, it unlocks many cool features!
text 0.89 KB | None | 0 0
  1. Comm comm = new Comm();
  2. string message = null;
  3. if (InputBox.Text == "say " + message)
  4. {
  5. OutputBox.AppendText(comm.do_say(message));
  6. }
  7.  
  8. class Comm
  9. {
  10. public string do_say(string message)
  11. {
  12. return "You say: " + message + "n";
  13. }
  14. }
  15.  
  16. (InputBox.Text == "say " + message)
  17.  
  18. (InputBox.Text == "say {0}", message)
  19.  
  20. if(InputBox.Text.StartsWith("Say "))
  21. OutputBox.Text += InputBox.Text.SubString(4);
  22.  
  23. if (InputBox.Text == "say " + message)
  24.  
  25. Match m = Regex.Match(InputBox.Text, @"^says+(.*)$", RegexOptions.IgnoreCase);
  26. if (m.Success)
  27. {
  28. OutputBox.AppendText(Comm.GetScreenoutput(m.Groups[1].Value));
  29. }
  30.  
  31. static class Comm
  32. {
  33. public static string GetScreenOutput(string message)
  34. {
  35. return "You say: " + message + "n";
  36. }
  37. }
  38.  
  39. if (InputBox.Text.ToUpper().StartsWith("SAY "))
  40. {
  41. OutputBox.AppendText(comm.do_say(message));
  42. }
Add Comment
Please, Sign In to add comment