Lia Meeds

Lia Meeds

  • NA
  • 110
  • 4.4k

How to do If Statement to detect multiple words in a string?

Apr 12 2020 10:53 PM
private void ButtonCheck_Click(object sender, EventArgs e)
{
   string s = textBoxMessage.Text;
   if (s.Contains("FREE") == true)
   {
         MessageBox.Show("Its not a SPAM", "SMS SPAM DETECTION TOOL | KEYWORD",          MessageBoxButtons.OK, MessageBoxIcon.Information);
   }
   else if (s.Contains("GET") == true)
   {
         MessageBox.Show("Its a SPAM", "SMS SPAM DETECTION TOOL | KEYWORD",          MessageBoxButtons.OK, MessageBoxIcon.Information);
   }
   else
  {
         MessageBox.Show("Its not a SPAM", "SMS SPAM DETECTION TOOL", MessageBoxButtons.OK,          MessageBoxIcon.Information);
   }
}





I dont know how to detect multiple words in a sentence.

Answers (4)