Advertisement
Not a member of Pastebin yet?
Sign Up,
it unlocks many cool features!
- using System.Collections.Generic;
- using System.IO;
- using System.Linq;
- namespace P05_WriteToFile
- {
- class WriteToFile
- {
- static void Main()
- {
- string textFromFile = File.ReadAllText("sample_text.txt");
- var fullText = new List<string>();
- var text = textFromFile.Split(".,!?:".ToCharArray()).ToList();
- foreach (var word in text)
- {
- fullText.Add(word);
- }
- File.WriteAllText("output.txt", string.Join("", fullText));
- }
- }
- }
Advertisement
Add Comment
Please, Sign In to add comment
Advertisement