Get directory from string file path

Hi,
How to get in dynamo from

file path:
C:\Users\user\Desktop\SAM_Bath\2017-03-27\file1.tsd

to directory:
C:\Users\user\Desktop\SAM_Bath\2017-03-27

I am using string parameter as file path stored in revit model,

Hi @Michal_Dengusiak

String.Remove will do the job.

thanks but I want to get more flexibility,as file name length will always be different

@Michal_Dengusiak

7 Likes