Advertisement
Not a member of Pastebin yet?
Sign Up,
it unlocks many cool features!
- using System;
- using System.Collections.Generic;
- using System.Linq;
- using System.Text;
- using System.IO;
- namespace _1.PrintOddLinesOfTextFile
- {
- class PrintOddLinesOfTextFile
- {
- static void Main()
- {
- StreamReader reader = new StreamReader("test.txt");
- string fileContent = reader.ReadToEnd();
- string[] textRows = fileContent.Split('\n');
- for (int i = 0; i < textRows.Length; i = i + 2)
- {
- Console.WriteLine(textRows[i]);
- }
- }
- }
- }
Advertisement
Add Comment
Please, Sign In to add comment
Advertisement