Advertisement
Not a member of Pastebin yet?
Sign Up,
it unlocks many cool features!
- using System;
- namespace String_Explosions
- {
- class Program
- {
- static void Main(string[] args)
- {
- string[] input = Console.ReadLine().Split("\\\\");
- string file = input[input.Length - 1];
- string fileName = file.Substring(0, file.LastIndexOf("."));
- string fileExtension = file.Substring(file.LastIndexOf('.') + 1);
- Console.WriteLine($"File name: {fileName} \nFile extension: {fileExtension}");
- }
- }
- }
Advertisement
Add Comment
Please, Sign In to add comment
Advertisement