NAnt SDK Documentation - v0.92 |

# PathFunctions.GetPathRoot Method

Gets the root directory of the specified path.

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

#### Parameters

path
  The path from which to obtain root directory information.

#### Return Value

A String containing the root directory of path, such as "C:\", or an empty String if path does not contain root directory information.

#### Exceptions

Exception Type | Condition
--- | ---
ArgumentException | path contains invalid characters, or is empty.

#### See Also

PathFunctions Class | NAnt.Core.Functions Namespace