GetExtension does not work when there is "." in the name of the file

Hello,

When using “GetExtension” in the name of a file, if such a name contains some more “.” then it does not work.

For instance:

File name -> " date file . sddf .pdf"

The GetExtension retrieves “. sddf .pdf” not “.pdf”.

Any way to solve it?

@EngAnalyst could you be a little specific? Please share a screenshot or your xaml file so, I could give you a proper solution :slight_smile:

@EngAnalyst ,

True - Get Extensions will give you the extension after the first dot . when you have 2 dots in an FileName you get .sdff.pdf

Solution May be - Once the extension is received in say a string variable say strExtn.

you can have a check in the string Variable - Is there are any dot if Yes - then we split the Extension by dot and get the last item in the split result to get the actual extension.

Hope it make sense


Mukesh