I am looking for a way to return fileName from the full path, but without the extension.
private static string ReturnFileNameWithoutExtension(string varFullPathToFile) { string fileName = new FileInfo(varFullPathToFile).Name; string extension = new FileInfo(varFullPathToFile).Extension; return fileName.Replace(extension, ""); }
Is there still a bulletproof solution, and then replace the extension with an empty string?
Madboy
source share