RNovachkov

Untitled

Jun 24th, 2017
168
0
Never
Not a member of Pastebin yet? Sign Up, it unlocks many cool features!
C# 0.56 KB | None | 0 0
  1. using System;
  2. using System.Collections.Generic;
  3. using System.Linq;
  4. using System.IO;
  5. using System.Text;
  6. using System.Threading.Tasks;
  7.  
  8. namespace _05.WriteToFile
  9. {
  10.     class Program
  11.     {
  12.         static void Main(string[] args)
  13.         {
  14.             var text = File.ReadAllText("sample_text.txt").Split(new[] { '.', ',', '!', '?', ':' }, StringSplitOptions.RemoveEmptyEntries).ToList();
  15.             if (!File.Exists("outputter.txt"))
  16.             {
  17.                 File.WriteAllText("output.txt", string.Join(" ", text));
  18.             }
  19.         }
  20.     }
  21. }
Advertisement
Add Comment
Please, Sign In to add comment