Get filename without extension

Posted by Venkat | Labels:

To get the filename without extension

There's an existing method in the System.IO namespace which can return a file name without the extension. You can call this passing in either a full file path, or just a file name.

For example:


string fileName = System.IO.Path.GetFileNameWithoutExtension("building.jpg")

PayOffers.in