Need help to fetch name of file from path

how to fetch name of file from filepath
C:\Users12\some\Downloads\Sample-Fillable-PDF.pdf

Thanks in advance

@SR_9128
you can use below approaches:
strfilePath=C:\Users12\some\Downloads\Sample-Fillable-PDF.pdf

Path.GetFileNameWithoutExtension(strfilePath)
output: Sample-Fillable-PDF

Path.GetFileName(strfilePath)
output: Sample-Fillable-PDF.pdf

Hope it helps!!

2 Likes

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