title: Loop through string and remove any occurrence of specified word
body: <p>I'm trying to remove all conjunctions and pronouns from any array of strings(let call that array A), The words to be removed are read from a text file and converted into an array of strings(lets call that array B).</p>
  
  <p>What I need is to Get the first element of array A and compare it to every word in array B, if the word matches I want to delete the word of array A.</p>
  
  <p>For example:</p>
  
  <p>array A = [0]I [1]want [2]to [3]go [4]home [5]and [6]sleep<br>
  array B = [0]I [1]and [2]go [3]to <br></p>
  
  <p>Result= array A = [0]want [1]home [2]sleep</p>
  
  <pre><code>//remove any duplicates,conjunctions and Pronouns
          public IQueryable&lt;All_Articles&gt; removeConjunctionsProNouns(IQueryable&lt;All_Articles&gt; myArticles)
          {
              //get words to be removed
              string text = System.IO.File.ReadAllText("A:\\EnterpriceAssigment\\EnterpriceAssigment\\TextFiles\\conjunctions&amp;ProNouns.txt").ToLower();
              //split word into array of strings 
              string[] wordsToBeRemoved = text.Split(',');
              //all articles
              foreach (var article in myArticles)
              {
                 //split articles into words
                  string[] articleSplit = article.ArticleContent.ToLower().Split(' ');
                  //loop through array of articles words
                  foreach (var y in articleSplit)
                  {
                      //loop through words to be removed from articleSplit
                      foreach (var x in wordsToBeRemoved)
                      {
                          //if word of articles matches word to be removed, remove word from article
                          if (y == x)
                          {
                              //get index of element in array to be removed
                              int g = Array.IndexOf(articleSplit,y);
                              //assign elemnt to ""
                              articleSplit[g] = "";
                          }
                      }
                  }
                  //re-assign splitted article to string
                  article.ArticleContent = articleSplit.ToString();
              }
              return myArticles;
          }
  </code></pre>
  
  <p>If it is possible as well, I need array A to have no duplicates/distinct values. </p>