NAnt SDK Documentation - v0.92 |

# PathFunctions.GetFileName Method

Returns the filename for the specified path string.

[Visual Basic]
<Function(Name:="get-file-name")>
Public Shared Function GetFileName( _
ByVal path As String _
) As String
[C#]
[Function(Name="get-file-name")]
public static string GetFileName(
string path
);

#### Parameters

path
  The path string from which to obtain the file name and extension.

#### Return Value

A String consisting of the characters after the last directory character in path.

If the last character of path is a directory or volume separator character, an empty String is returned.

#### Exceptions

Exception Type | Condition
--- | ---
ArgumentException | path contains one or more invalid characters.

#### See Also

PathFunctions Class | NAnt.Core.Functions Namespace