title: C# Check if DataGridView Contains specific word
body: <p>I'm currently working on an IRC bot. The sent messages will be shown in a DataGridView. So now I want to check if for example the sent message contains a specific word. Let's say "test".</p>
  
  <p>So it should check for the following:</p>
  
  <p>Let's say the sent message, which is added to the DataGridView is: My name is test.</p>
  
  <p>Now the Cell, which contains the word "test" should get colored red.</p>
  
  <p>I already solved this, when the message ONLY contains "test". But I don't really know how to check for a word in a sentence.</p>
  
  <p>//Edit: I tried this code:</p>
  
  <pre><code>foreach (DataGridViewRow row in dataGridView1.Rows)
  {
        if (row.Cells[1].Value.ToString() == "test")
            row.Cells["chat1"].Style.ForeColor = Color.Red;
            //row.Cells["chat1"].Style.ForeColor = Color.CadetBlue;
  }
  </code></pre>
  
  <p>Kind Regards,
  Max :)</p>