Path.Combine Method (array<String>[]()[])

[ This article is for Windows Phone 8 developers. If you’re developing for Windows 10, see the latest documentation. ]

Combines an array of strings into a path.

Namespace: System.IO
Assembly: mscorlib (in mscorlib.dll)


Public Shared Function Combine ( _
    ParamArray paths As String() _
) As String
public static string Combine(
    params string[] paths


Return Value

Type: System..::.String
A string that contains the combined paths.


Exception Condition

One of the strings in the array contains one or more of the invalid characters defined in GetInvalidPathChars.


One of the strings in the array is nullNothingnullptra null reference (Nothing in Visual Basic).


paths should be an array of the parts of the path to combine. If the one of the subsequent paths is an absolute path, then the combine operation resets starting with that absolute path, discarding all previous combined paths.

Zero-length strings are omitted from the combined path.

Version Information

Windows Phone OS

Supported in: 8.1, 8.0

See Also


Path Class

Combine Overload

System.IO Namespace