c# 4.0 - Return filename without extension from full path in C# -
this question has answer here:
- c# getting file names without extensions 10 answers
i'm looking way return filename full path without 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 more bullet proof solution replacing extension empty string?
return path.getfilenamewithoutextension (fullpath);
Comments
Post a Comment