PathGetExtension Method (String, Boolean) |
Returns the extension of the specified path string.
Namespace: Alphaleonis.Win32.FilesystemAssembly: AlphaFS (in AlphaFS.dll) Version: 2.0
Syntax public static string GetExtension(
string path,
bool checkInvalidPathChars
)
Public Shared Function GetExtension (
path As String,
checkInvalidPathChars As Boolean
) As String
public:
static String^ GetExtension(
String^ path,
bool checkInvalidPathChars
)
static member GetExtension :
path : string *
checkInvalidPathChars : bool -> string
Parameters
- path
- Type: SystemString
The path string from which to get the extension. The path cannot contain any of the characters defined in GetInvalidPathChars. - checkInvalidPathChars
- Type: SystemBoolean
will check path for invalid path characters.
Return Value
Type:
StringThe extension of the specified path (including the period "."), or null, or Empty.
If path is null, this method returns null.
If path does not have extension information,
this method returns Empty.
Exceptions Exception | Condition |
---|
ArgumentException | The path parameter contains invalid characters, is empty, or contains only white spaces. |
See Also