GetExtension Method
[This documentation is for preview only, and is subject to change in later releases. Blank topics are included as placeholders.]
Returns the extension of the specified path string.
Namespace: System.IO
Assembly: System.IO (in System.IO.dll)
Syntax
'Declaration
Public Shared Function GetExtension ( _
path As String _
) As String
public static string GetExtension(
string path
)
public:
static String^ GetExtension(
String^ path
)
static member GetExtension :
path:string -> string
public static function GetExtension(
path : String
) : String
Parameters
- path
Type: System. . :: . .String
The path string from which to get the extension.
Return Value
Type: System. . :: . .String
The extension of the specified path (including the period "."), or nullNothingnullptrunita null reference (Nothing in Visual Basic), or String..::..Empty. If path is nullNothingnullptrunita null reference (Nothing in Visual Basic), GetExtension returns nullNothingnullptrunita null reference (Nothing in Visual Basic). If path does not have extension information, GetExtension returns String..::..Empty.
Remarks
The extension of path is obtained by searching path for a period (.), starting with the last character in path and continuing toward the start of path. If a period is found before a DirectorySeparatorChar character, the returned string contains the period and the characters after it; otherwise, Empty is returned.
.NET Framework Security
- Full trust for the immediate caller. This member cannot be used by partially trusted code. For more information, see dd66cd4c-b087-415f-9c3e-94e3a1835f74.