PathGetFileNameWithoutExtension Method (String, Boolean) |
[AlphaFS] Returns the file name of the specified path string without the extension.
Namespace: Alphaleonis.Win32.FilesystemAssembly: AlphaFS (in AlphaFS.dll) Version: 2.0
Syntax public static string GetFileNameWithoutExtension(
string path,
bool checkInvalidPathChars
)
Public Shared Function GetFileNameWithoutExtension (
path As String,
checkInvalidPathChars As Boolean
) As String
public:
static String^ GetFileNameWithoutExtension(
String^ path,
bool checkInvalidPathChars
)
static member GetFileNameWithoutExtension :
path : string *
checkInvalidPathChars : bool -> string
Parameters
- path
- Type: SystemString
The path of the file. 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 string returned by GetFileName, minus the last period (.) and all characters following it.
Exceptions Exception | Condition |
---|
ArgumentException | The path parameter contains invalid characters, is empty, or contains only white spaces. |
See Also