title: Read single cell in a DataGridView as a string
body: <p>I'm reading all the cells in a <code>DataGridView</code>, but on each of them I want to compare the first 3 elements of the cell as a string, and turn it into a blank cell if they match.</p>
  
  <p>So far I've tried this</p>
  
  <pre><code> for (int z = 0; z &lt; dataGridView7.Rows.Count; z++)
   {
       for (int i = 0; i &lt; dataGridView7.Columns.Count; i++)
       {
            string caixa = dataGridView7[z, i].Value.ToString(); //problem right here
            string caixaselecta = caixa.Substring(0, 3);
  
            if (caixaselecta == "0 *")
            {
                dataGridView7[z, i].Value = "";
            }
      }
  }
  </code></pre>
  
  <p>The <code>for</code> cycles are correctly done, and the matches too. I think the problem is identifying the current cell being analyzed, and turn it into a string.</p>
  
  <p>I've tried similar ways to reach the current cell, but either I get a error, or the string <code>caixa</code> isn't correctly defined.</p>
  
  <p>Any hints?</p>