Returns the extension of the specified path string.
Assemblies: mscorlib (in mscorlib.dll)
System.Runtime.Extensions (in System.Runtime.Extensions.dll)
- Type: System.String
The path string from which to get the extension.
Return ValueType: System.String
The extension of the specified path (including the period "."), or a null reference (Nothing in Visual Basic), or String.Empty. If path is a null reference (Nothing in Visual Basic), returns a null reference (Nothing in Visual Basic). If path does not have extension information, returns String.Empty.
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 or AltDirectorySeparatorChar character, the returned string contains the period and the characters after it; otherwise, Empty is returned.
For a list of common I/O tasks, see Common I/O Tasks.