Click or drag to resize
PathGetFileNameWithoutExtension Method
Returns the file name of the specified path string without the extension.

Namespace: System.IO
Assembly: mscorlib (in mscorlib.dll) Version: 4.0.0.0
Syntax
C#
public static string GetFileNameWithoutExtension(
	string path
)

Parameters

path
Type: SystemString
The path of the file.

Return Value

Type: String
The string returned by GetFileName(String), minus the last period (.) and all characters following it.
Exceptions
ExceptionCondition
ArgumentExceptionpath contains one or more of the invalid characters defined in GetInvalidPathChars.
See Also