Given a filesystem path, is there a shorter way to extract the filename without its extension?

Path.GetFileName

Returns the file name and extension of a file path that is represented
by a read-only character span.


Path.GetFileNameWithoutExtension

Returns the file name without the extension of a file path that is
represented by a read-only character span.


The Path class is wonderful.

Leave a Comment