How to get file name without extension from CurrentFile.ToString

hi guys I am trying to get the file name from each file in a “for each” loop under another “for each folder in folder” activity. I used to get it by CurrentFile.ToString, but it includes the extension which I want to get rid of. Any ways that can enable me to do it?

Hi @Ben_siu

Can you share the error message here?

You have to pass the folder and file path in the path location

Path.GetFileNameWithoutExtension(CurrentFile.ToString)

image

Regards
gokul

@Ben_siu Try this
currentfile.name

currentfile.name.Tostring

1 Like

HI @Ben_siu

You can try with this


Path.GetFileNameWithoutExtension(CurrentFile.ToString)

Regards
Sudharsan

1 Like

This topic was automatically closed 3 days after the last reply. New replies are no longer allowed.