Kanekotic/C# - Path.Combine

Created Thu, 04 Feb 2016 09:56:49 +0200 Modified Sun, 05 Dec 2021 10:26:06 +0000

When using path.Combine if the second argument starts with a /. the first path is ignored and will give a path based on the C: drive.

var path = Path.Combine(firstpath,$@"\myfolder\myfile.txt");

will not return <firstpath\myfolder\myfile.txt> will return <C:\\myfolder\myfile.txt>.