PathChangeExtension Method |
Changes the extension of a path string.
Namespace: Alphaleonis.Win32.FilesystemAssembly: AlphaFS (in AlphaFS.dll) Version: 2.0
Syntax public static string ChangeExtension(
string path,
string extension
)
Public Shared Function ChangeExtension (
path As String,
extension As String
) As String
public:
static String^ ChangeExtension(
String^ path,
String^ extension
)
static member ChangeExtension :
path : string *
extension : string -> string
Parameters
- path
- Type: SystemString
The path information to modify. The path cannot contain any of the characters defined in GetInvalidPathChars. - extension
- Type: SystemString
The new extension (with or without a leading period). Specify to remove an existing extension from path.
Return Value
Type:
StringThe modified path information.
Exceptions Exception | Condition |
---|
ArgumentException | The path parameter contains invalid characters, is empty, or contains only white spaces. |
See Also