code4it-dev / blog-comments

https://www.code4it.dev/
1 stars 0 forks source link

csharptips/path-combine-vs-path-join/ #68

Open utterances-bot opened 3 months ago

utterances-bot commented 3 months ago

C# Tip: Path.Combine and Path.Join are similar but way different. | Code4IT

Code4IT - a blog for .NET enthusiasts, Azure lovers, and Backend developers

https://www.code4it.dev/csharptips/path-combine-vs-path-join/

neilboyd commented 3 months ago

Why would you use Path.Join? It's more likely to return the wrong result.

LexaGV commented 3 months ago

It's least and primitive info I would like to know. More important is how to deal with ".." parts - ideally programmer wants 'Path' to handle all of that automatically. (and w/o involving real file system)