Click or drag to resize
PathGetExtension Method
Returns the extension of the specified path string.

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

Parameters

path
Type: SystemString
The path string from which to get the extension.

Return Value

Type: String
The extension of the specified path (including the period "."), or null, or Empty. If path is null, GetExtension(String) returns null. If path does not have extension information, GetExtension(String) returns Empty.
Exceptions
ExceptionCondition
ArgumentExceptionpath contains one or more of the invalid characters defined in GetInvalidPathChars.
See Also