Determines whether a path includes a file name extension.
Namespace: Alphaleonis.Win32.FilesystemAssembly: AlphaFS (in AlphaFS.dll) Version: 2.0
Syntax public static bool HasExtension(
string path
)
Public Shared Function HasExtension (
path As String
) As Boolean
public:
static bool HasExtension(
String^ path
)
static member HasExtension :
path : string -> bool
Parameters
- path
- Type: SystemString
The path to search for an extension. The path cannot contain any of the characters defined in GetInvalidPathChars.
Return Value
Type:
Boolean if the characters that follow the last directory separator (\\ or /) or volume separator (:) in the path include a period (.) followed by one or more characters; otherwise,
.
Exceptions Exception | Condition |
---|
ArgumentException | The path parameter contains invalid characters, is empty, or contains only white spaces. |
See Also