Advertisement
Guest User

Untitled

a guest
Nov 21st, 2019
87
0
Never
Not a member of Pastebin yet? Sign Up, it unlocks many cool features!
text 1.11 KB | None | 0 0
  1. using System;
  2. using System.IO;
  3. using System.Linq;
  4. using System.Text;
  5.  
  6.  
  7. namespace ConsoleApp1
  8. {
  9. class Program
  10. {
  11. static void Main(string[] args)
  12. {
  13. string path = @"D:\Users\karen.barseghyan\Desktop\lorem.txt";
  14.  
  15. /*
  16. if (!File.Exists(path))
  17. {
  18. // Create a file to write to.
  19. string createText = "Hello and Welcome" + Environment.NewLine;
  20. File.WriteAllText(path, createText, Encoding.UTF8);
  21. }
  22. */
  23.  
  24. // Open the file to read from.
  25. string readText = File.ReadAllText(path);
  26. // Console.WriteLine(readText);
  27. string[] splut = readText.Split("\r\n");
  28. string[] contain;
  29.  
  30.  
  31.  
  32.  
  33.  
  34. for (int i = 0; i<splut.Length; i++)
  35. {
  36.  
  37. contain = splut[i].Split(' ');
  38. foreach (var s in contain)
  39. {
  40. // Console.WriteLine(i+s);
  41.  
  42.  
  43. }
  44.  
  45. }
  46. }
  47.  
  48.  
  49.  
  50. }
  51.  
  52.  
  53.  
  54. }
Advertisement
Add Comment
Please, Sign In to add comment
Advertisement