Find Modified Word From String In C#

  1. using System;  
  2. using System.Net.NetworkInformation;  
  3. using System.Net;  
  4. using System.Net.Sockets;  
  5. using System.Text.RegularExpressions;  
  6. namespace Example  
  7. {  
  8.      
  9.     class Program  
  10.     {  
  11.   
  12.   
  13.         static void Main()  
  14.         {  
  15.             string s1 = "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.";  
  16.             string s2 = "When you are wrting server code yu cannn never be sure what the IP address you see is refering to.In fact some users like it this way";  
  17.   
  18.             string[] tempArr1 = s1.Split(' ');  
  19.             string[] tempArr2 = s2.Split(' ');  
  20.             int counter = 0;  
  21.   
  22.             for (int i = 0; i < tempArr1.Length; i++)  
  23.             {  
  24.                 if (tempArr1[i] != tempArr2[i])  
  25.                 {  
  26.                     Console.WriteLine(tempArr1[i] + ", " + tempArr2[i]);  
  27.                     counter++;  
  28.                       
  29.                 }  
  30.             }  
  31.             Console.WriteLine("Total Modified Word::"+counter);  
  32.             
  33.             Console.ReadLine();  
  34.         }  
  35.     }  
  36. }