title: Comparing array and get another array value on the selected array
body: <p>Please help me. I'm stuck on my array case. I'm newbie on this. Espesially to get array more than 2 variables. I had already browsing into google but i didn't got what i want, and now I've got stuck on it :(</p>
  
  <p>I have array like this </p>
  
  <pre><code>string[] receive = receiveattachment.Split(new char[] { ',' });//{1,0,1,0}
  string[] display = isdisplaytotal.Split(new char[] { ',' });//{1,1,1,0}
  string[] ccTemp = cc.Split(new char[] { ',' });//{a@gmail.com, b@gmail.com, c@gmail.com, d@gmail.com}
  </code></pre>
  
  <p>First of all i got the same value from receive and display by this</p>
  
  <pre><code>foreach (var receive_ in receive)
                      {
                          foreach (var display_ in display)
                          {
                              if (receive_ == display_)
                              {
                                //do something
                              }
                          }
  }
  </code></pre>
  
  <p>then my problem is, how to get a@gmail.com, c@gmail.com ?
  I tried like this</p>
  
  <pre><code> foreach (var receive_ in receive)
                          {
                              foreach (var display_ in display)
                              {
                                  if (receive_ == display_)
                                  {
                                      string[] ccTemp = cc.Split(new char[] { ',' });
                                      for (int i = 0; i &lt; receive.Length; i++)
                                      {
                                          if (receive[i] == "1")
                                          {
                                              if (_ccIsReceiveAndDisplay.Trim() != "") _ccIsReceiveAndDisplay += ",";
                                              _ccIsReceiveAndDisplay += ccTemp[i];
                                          }
                                          else
                                          {
                                              if (_ccIsReceiveAndDisplay.Trim() != "") _ccIsReceiveAndDisplay += ",";
                                              _ccIsReceiveAndDisplay += ccTemp[i];
                                          }
                                      }
                                  }
                              }
      }
  </code></pre>
  
  <p>but it will got only receive = 1 value. not receive 1 and display =1</p>