Mono Class Library: System.IO.Path Overview | Members

System.IO.Path.ChangeExtension Method

Changes the extension component of the specified path string. [Edit]

public static string ChangeExtension (string path, string extension)

Parameters

path
A string containing the path information to modify. [Edit]
extension
A string containing the new extension. Specify null to remove an existing extension from path. [Edit]

Returns

A string containing the modified path information.

Platforms that do not support this feature return path unmodified.

[Edit]

Exceptions

TypeReason
ArgumentExceptionpath contains one or more implementation-specific invalid characters. [Edit]

Remarks

The exact behavior of this method is implementation-specific. This method checks path for invalid characters as defined by the current platform and file system. [Edit]

Requirements

Namespace: System.IO
Assembly: mscorlib (in mscorlib.dll)
Assembly Versions: 1.0.5000.0, 2.0.0.0