Skip to main content
Post Made Community Wiki by CommunityBot
Source Link
ageektrapped
  • 14.6k
  • 7
  • 61
  • 75

This isn't C# per se, but I haven't seen anyone who really uses System.IO.Path.Combine() to the extent that they should. In fact, the whole Path class is really useful, but no one uses it!

I'm willing to bet that every production app has the following code, even though it shouldn't:

string path = dir + "\\" + fileName;