FileNameTake
FileNameTake["name"] gives the last path element in the file name "name".
FileNameTake["name",n] gives the first n path elements in the file name "name".
FileNameTake["name",-n] gives the last n path elements in the file name "name".
FileNameTake["name",{m,n}] gives elements m through n in the file name "name".
Please visit the official Wolfram Language Reference for more details and examples on core symbols.