title: How can I compare changing words between two strings in asp.net
body: <p>In my application, I have two strings and I need to display missing words that count, Inserting words that count and modified words that count between them.
  For example:</p>
  
  <pre><code>  string variable1="When you are writing server code you can never be sure what the IP address you see is refereeing to.In fact some users like it this way.";
    string variable2="when are wrting server code yu cannn never be sure **Demo** what the address you is to.In fact **Demo1** some users like it this way";
  </code></pre>
  
  <p>The result should be:</p>
  
  <pre><code>  Missing Words: you, see ,IP
    Missing Words count: 3
  
    Inserted: Demo, Demo1 
    Inserted Words count: 2
  
    Modified words : wrting,yu ,cannn ,refering
    Modified words count :4
  </code></pre>
  
  <p>I tried this but it not display properly in Modified Words</p>
  
  <pre><code>string variable1="When you are writing server code you can never be sure what the IP address you see is refereeing to.In fact some users like it this way.";
     string variable2="when are wrting server code yu cannn never be sure **Demo** what the IP address you see is to.In fact **Demo1** some users like it this way";
  
       //Missing Word Count    
       var result = variable1.Split(new char[] { ' ' }).Except(variable2.Split(new char[] { ' ' })).ToArray();
       count = result.Length;
       Label2.Text += "Missing Word Count: " + count.ToString() + "&lt;br/&gt;&lt;br/&gt;";
       for (int i = 0; i &lt; count; i++)
       {
         Label1.Text += "Missing Word: " + result[i].ToString() + "&lt;br/&gt;&lt;br/&gt;";
       }
  
  
       //Insert Word
       var result1 = variable2.Split(new char[] { ' ' }).Except(variable1.Split(new char[] { ' ' })).ToArray();
       count = 0;
       count = result1.Length;
       for (int i = 0; i &lt; count; i++)
       {
           Label3.Text += "Insert Word: " + result1[i].ToString() + "&lt;br/&gt;&lt;br/&gt;";
  
       }
       Label4.Text += "Insert Word Count: " + count.ToString() + "&lt;br/&gt;&lt;br/&gt;";    
  
       //Modifide Words
       string[] tempArr1 = variable1.Split(' ');  
       string[] tempArr2 = variable2.Split(' ');  
       int counter = 0;  
  
       for (int i = 0; i &lt; tempArr1.Length; i++)  
       {  
           if (tempArr1[i] != tempArr2[i])  
           {  
              lblwords.text=tempArr1[i] + ", "+ tempArr2[i];  
               counter++;  
           }  
       } 
  </code></pre>
  
  <p>Can anyone help me to how to do this. </p>
  
  <p>Thank you</p>