Combine an array of strings into a path in CSharp
Description
The following code shows how to combine an array of strings into a path.
Example
/*from w w w.java2s .c om*/
using System;
using System.IO;
public class MainClass {
public static void Main() {
string[] paths = {@"c:\a", "2001", "media", "images"};
string fullPath = Path.Combine(paths);
Console.WriteLine(fullPath);
}
}
The code above generates the following result.