TheBulgarianWolf

Extract FIle

Mar 19th, 2021
717
0
Never
Not a member of Pastebin yet? Sign Up, it unlocks many cool features!
C# 0.54 KB | None | 0 0
  1. using System;
  2.  
  3. namespace ExtractFile
  4. {
  5.     class Program
  6.     {
  7.         static void Main(string[] args)
  8.         {
  9.             Console.WriteLine("Enter your directory: ");
  10.             string directory = Console.ReadLine();
  11.             string[] separated = directory.Split("\\");
  12.             string file = separated[separated.Length - 1];
  13.             string[] fileConc = file.Split(".");
  14.             Console.WriteLine("File name: " + fileConc[0]);
  15.             Console.WriteLine("File extension: " + fileConc[1]);
  16.  
  17.         }
  18.     }
  19. }
  20.  
Add Comment
Please, Sign In to add comment