title: LINQ Operator '==' cannot be applied to operands of type 'char' and 'string'
body: <p>I hardly used LINQ in the past. When I tried to compose a little LINQ query today using LinqPad, then I got the following error: </p>
  
  <p><code>Operator '==' cannot be applied to operands of type 'char' and 'string'</code></p>
  
  <p>This is the script I was trying to write:</p>
  
  <pre><code>void Main()
  {
              var csvlines = File.ReadAllLines(@"M:\smdr(backup08-06-2015).csv");
              var csvLinesData = csvlines.Skip(1).Select(l =&gt; l.Split(',').ToArray());
              var csvData = csvLinesData.Where(l =&gt; (!l[12].Contains("VM") &amp;&amp; l[12] != "Voice Mail")).ToArray();
              var user = (from r in csvData
                          orderby r[12]
                          select new User
                          {
                              CSRName = r[12],
  
                              Incomming = (from r1 in r
                                           where r1[4] == "I"
                                           select r1).Count(),
                              outgoing = (from r1 in r
                                          where r1[4] == "O"
                                          select r1).Count()
  
  
  
                          }).ToList();
                          user.Dump();
  }
  
  class User
  {
      public string CSRName;
      public int Outgoing;
      public int Incomming;
      public int calltransfer;
  }
  </code></pre>
  
  <h2>EDIT 1</h2>
  
  <p>As per suggestion I edited the code</p>
  
  <pre><code>                    select new User 
                      {
                          CSRName=r[12],
                          Incomming=(from r1 in r
                                    where r1[4]=='I'
                                    select r1).Count(),
                          outgoing = (from r1 in r
                                      where r1[4] == 'O'
                                      select r1).Count()
  
                      }).ToList();
  </code></pre>
  
  <p>Now it compiles, but it is throwing a different error:</p>
  
  <p><code>IndexOutOfRangeException: Index was outside the bounds of the array.</code> </p>
  
  <p>Where I am making the mistake ?</p>