Combines two strings into a path. : Path « File Stream « C# / C Sharp
- C# / C Sharp
- File Stream
- Path
Combines two strings into a path.
using System;
using System.IO;
public class MainClass {
public static void Main() {
string path1 = "c:\\temp";
string path2 = "subdir\\file.txt";
string combination = Path.Combine(path1, path2);
Console.WriteLine(combination);
}
}
Related examples in the same category