Share via


Path.GetExtension Method

Returns the extension of the specified path string.

Namespace: System.IO
Assembly: mscorlib (in mscorlib.dll)

Syntax

public static string GetExtension (
         stringpath
)

Parameters

  • path
    The path string from which to get the extension.

Return Value

A String containing the extension of the specified path (including the "."), null, or an empty string. If path is null, GetExtension returns null. If path does not have an extension, GetExtension returns a zero-length string.

Version Information

Available in the .NET Micro Framework versions 3.0, 4.0, and 4.1.

See Also

Reference

Path Class
Path Members
System.IO Namespace