Get CurrentFile Name without extension

Hello everyone,


I want just take the name of the current file without an extension
I tried this and it didn’t work
Path.GetFileNameWithoutExtension(CurrentFile.ToString)
CurrentFile.NameWithoutextension
any other ideas please?

Hi @Imene_ZARAI

Can you tell us what is the issue with this expression Path.GetFileNameWithoutExtension(CurrentFile.ToString)

Check out this thread

Regards
Gokul

Hi @Imene_ZARAI

Split it on dot and get the first part

Currentfile.Name.Split("."c)(0)

cheers

1 Like

Path.GetFileNameWithoutExtension(CurrentFile.ToString)

1 Like

Hi @Imene_ZARAI

Use this Currentfile.Name.Split("."c)(0)

or Path.GetFileNameWithOutExtension(Currentfile.FullName)

cheers

@Imene_ZARAI
Keep in mind that CurrentFile is of DataType: FileInfo

Have a look on the following samples:
grafik

So you can check and explore at your end while debugging within the immediate panel by yourself
Understanding the 6 Debugging Panels of UiPath in the easiest way possible! - News / Tutorials - UiPath Community Forum

1 Like

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