When is someone going to set up our Extension Method library?

April 5, 2008

The first method that should go in there is this one: very clever idea, and needed it only moments ago. Nothing revolutionary, but he’s right – almost every time you need to use String.Format, it’s after you’re halfway through writing a string…

You get to do things like this:

“Some long string la la la ooh {0} really should be a template”.FormatWith(this);

 

Click Here for the implementation: Format As Extension method

Share: These icons link to social bookmarking sites where readers can share and discover new web pages.
  • del.icio.us
  • DZone
  • Digg
  • Google Bookmarks
  • Ma.gnolia
  • Technorati
hello
  • Nathan
    Thanks Alex. Let's use something like Hsi.Code.Extensions, so that we can reserver Hsi.Extensions for when we build end user extensibility points into our products :)
  • Alex
    I suggest that, when appropriate, we have a folder (i.e., a namespace) called Extension at project level, and we can put one or more static classes there. That way, we know, by looking at the namespaces we include in code, where those extension methods in code come from. I will set up one for Hsi.Extension, and start putting some basic ones, like the string format.
blog comments powered by Disqus