In a nice little linq one liner with a lambda I handle the null case and aggregate all the paths with root:
public string CombinePaths(string root, params string[] args)
{
return Path.GetFullPath(args.Aggregate(root, (current, path) => Path.Combine(current ?? string.Empty, path ?? string.Empty)));
}
No comments:
Post a Comment