FileUtils.

CombinePaths(string, string) Method

Summary

Combines two path strings.
Assembly
NAnt.Core.dll
Namespace
NAnt.Core.Util
Containing Type
FileUtils

Syntax

public static string CombinePaths(string path1, string path2)

Remarks

On *nix, processing is delegated to System.IO.Path.Combine(System.String,System.String).

On Windows, this method normalized the paths to avoid running into the 260 character limit of a path and converts forward slashes in both path1 and path2 to the platform's directory separator character.

Parameters

Name Type Description
path1 string The first path.
path2 string The second path.

Return Value

Type Description
string A string containing the combined paths. If one of the specified paths is a zero-length string, this method returns the other path. If path2 contains an absolute path, this method returns path2.