Is there an easy method to combine two relative paths in C# ?
Posted
by Ioannis
on Stack Overflow
See other posts from Stack Overflow
or by Ioannis
Published on 2010-04-28T16:34:00Z
Indexed on
2010/04/28
16:43 UTC
Read the original article
Hit count: 262
I want to combine two relative paths in C#.
For example:
string path1 = "/System/Configuration/Panels/Alpha";
string path2 = "Panels/Alpha/Data";
I want to return
string result = "/System/Configuration/Panels/Alpha/Data";
I can implement this by splitting the second array and compare it in a for loop but I was wondering if there is something similar to Path.Combine
available or if this can be accomplished with regular expressions or Linq?
Thanks
© Stack Overflow or respective owner