Advertisement
Guest User

Untitled

a guest
Mar 27th, 2017
62
0
Never
Not a member of Pastebin yet? Sign Up, it unlocks many cool features!
text 0.65 KB | None | 0 0
  1. using System;
  2. using System.Linq;
  3. using System.IO;
  4.  
  5. namespace _01.FilterExtensions
  6. {
  7. public class FilterExtensions
  8. {
  9. public static void Main()
  10. {
  11. var files = Directory.GetFiles("input");
  12. var input = Console.ReadLine();
  13.  
  14. foreach (var file in files)
  15. {
  16. var currentFile = file.Split(new[] { '\\', '.' }, StringSplitOptions.RemoveEmptyEntries).ToList();
  17.  
  18. if (input == currentFile[currentFile.Count - 1])
  19. {
  20. Console.WriteLine(string.Join(".", currentFile));
  21. }
  22.  
  23. }
  24.  
  25. }
  26. }
  27. }
Advertisement
Add Comment
Please, Sign In to add comment
Advertisement