public static GetFileName ( string filePath ) : string | ||
filePath | string | file name, absolute path |
return | string |
public static string GetFileName( string filePath )
{
if ( filePath.EndsWith( @"/" ) )
throw new Exception( "Invalid argument for function:GetFileName" );
int idx = filePath.LastIndexOf( '/' );
return filePath.Substring( idx + 1 );
}