Advertisement
Guest User

Sampletext

a guest
Jun 30th, 2017
188
0
Never
Not a member of Pastebin yet? Sign Up, it unlocks many cool features!
C# 0.51 KB | None | 0 0
  1. using System;
  2. using System.IO;
  3.  
  4. namespace sampletext
  5. {
  6.     class Sampletext
  7.     {
  8.         static void Main()
  9.         {
  10.             //consider as punctuations only: “.”, “,”, “!”, “?” and “:”.
  11.             string[] words = File.ReadAllText(@"C:\Users\Thinkpad\Desktop\sampletext\sample_text.txt")
  12.                 .Split(new char[] { '.', ',', '!', '?', ':', },
  13.                 StringSplitOptions.RemoveEmptyEntries);
  14.  
  15.             Console.WriteLine(string.Join("", words));
  16.         }
  17.     }
  18. }
Advertisement
Add Comment
Please, Sign In to add comment
Advertisement