I've had a look at Path.Combine
and noticed it has four overloads:
string
, string
string
, string
, string
string
, string
, string
, string
params string[]
How are the first three overloads useful?
The way I see it, the fourth overload makes the others pretty pointless. I looked at the source and I did see that the fourth overload's implementation is a bit different, but even in this case I would expect to have just the one params
overload which decides which implementation to use based on the array's length.
According to this answer, https://stackoverflow.com/a/2796763/385844, it's to avoid the overhead of creating the parameter array, and because the non-params overloads are convenient for users of languages that do not support variable-length parameter lists.
See also