Advertisement
Guest User

Untitled

a guest
Nov 20th, 2019
86
0
Never
Not a member of Pastebin yet? Sign Up, it unlocks many cool features!
C# 1.20 KB | None | 0 0
  1. StringBuilder text = new StringBuilder();
  2.             int ind = 0;
  3.             int ind1 = 0;
  4.             string word;
  5.             string word1;
  6.             for (int i = ind; i < words1.Count; i++)
  7.             {
  8.                 if(words2.Contains(words1[i]))
  9.                 {
  10.                     word = words1[i];
  11.                     ind = words1.IndexOf(word);
  12.                     for (int j = ind1; j < words2.Count; j++)
  13.                     {
  14.                         if(words1.Contains(words2[j]) && words2[j] != word)
  15.                         {
  16.                            
  17.                             word1 = words2[j];
  18.                             ind1 = words2.IndexOf(word1);
  19.                             break;
  20.                         }
  21.                         else
  22.                         {
  23.                             if(words2[j] != word)
  24.                             text.AppendLine(words2[j]);
  25.                         }
  26.                     }
  27.                 }
  28.                 else
  29.                 {
  30.                     text.AppendLine(words1[i]);
  31.                 }                
  32.             }
  33.             string allText = text.ToString();
  34.             File.WriteAllText(fout, allText);
Advertisement
Add Comment
Please, Sign In to add comment
Advertisement