ZZ C # Gets the suffix file name, suffix name, file name based on absolute path
1. C # Gets the suffix file name, suffix name, and file name according to the absolute path.
String str = "F:\test\Default.aspx";
string filename = System.IO.Path.GetFileName (str);//filename "default.aspx"
string extension = System.IO.Path.GetExtension (str);//extension ". aspx"
String filenamewithoutextension = System.IO.Path.GetFileNameWithoutExtension (str);//File name "Default" with no extension
2. C # Gets the suffix file name, suffix name, and file name, using the Split function, based on the absolute path.
string str = = "F:\test\Default.aspx";
Char[] Delimiterchars = {'. ', ' \ \ '};
string[] mystr = str. Split (Delimiterchars);
String sheetname = mystr[mystr.length-2];);//File name "Default" with no extension
C # Gets the suffix file name, suffix name, file name based on absolute path