Bob103

C#_Collection(17-3)

Dec 13th, 2016
94
0
Never
Not a member of Pastebin yet? Sign Up, it unlocks many cool features!
C# 0.78 KB | None | 0 0
  1. class Program
  2.     {
  3.  
  4.         static void Main()
  5.         {
  6.             if (File.Exists("Input.txt"))
  7.             {
  8.                 var InputLines = new List<string>(File.ReadAllLines("Input.txt"));
  9.                 for (int numberLine = 0; numberLine < InputLines.Count; numberLine++)
  10.                 {
  11.                     for (int i = 0; i < InputLines[numberLine].Length; i++)
  12.                         if (InputLines[numberLine].Substring(i, 1).Equals("#"))
  13.                         {
  14.                             InputLines[numberLine] = InputLines[numberLine].Remove(i - 1, 2);
  15.                             i = i - 2;
  16.                         }
  17.                 }
  18.                 File.AppendAllLines("Out.txt", InputLines);
  19.             }
  20.         }
  21.     }
  22.  
  23. In file: abc#kek###d#
Advertisement
Add Comment
Please, Sign In to add comment