Dave Chestnutt: SparklingCode and CodeGaffes

Writing better code; for fun and profit

  Home  |   Contact  |   Syndication    |   Login
  18 Posts | 1 Stories | 208 Comments | 20 Trackbacks

News

Tag Cloud


Article Categories

Archives

Post Categories

March 2007 Entries

The CLR is full of surprises. Microsoft has a built-in System.IO.Path class, to deal with all the path parsing issues we often run across. One of the most useful methods in there can get rid of all the special case code we write to combine path strings. How many times have you written something like this to combine two path strings -- taking into account whether you need to add a slash between the path strings or not: String path1 = @"C:\ABC"; // may or may not end in a slash String path2 = @"DEF";...
  • Share This Post:
  • Share on Twitter
  • Share on Facebook
  • Share on Technorati