Advertisement
Not a member of Pastebin yet?
Sign Up,
it unlocks many cool features!
- using System;
- using System.IO;
- using System.Linq;
- using System.Text;
- namespace ConsoleApp1
- {
- class Program
- {
- static void Main(string[] args)
- {
- string path = @"D:\Users\karen.barseghyan\Desktop\lorem.txt";
- /*
- if (!File.Exists(path))
- {
- // Create a file to write to.
- string createText = "Hello and Welcome" + Environment.NewLine;
- File.WriteAllText(path, createText, Encoding.UTF8);
- }
- */
- // Open the file to read from.
- string readText = File.ReadAllText(path);
- // Console.WriteLine(readText);
- string[] splut = readText.Split("\r\n");
- string[] contain;
- for (int i = 0; i<splut.Length; i++)
- {
- contain = splut[i].Split(' ');
- foreach (var s in contain)
- {
- // Console.WriteLine(i+s);
- }
- }
- }
- }
- }
Advertisement
Add Comment
Please, Sign In to add comment
Advertisement