Can someone explain to me why in .NET I would write String.IsNullOrEmpty(str) instead of str.IsNullOrEmpty()? There must be a logical reason but I don't know it.

It sounds like you guys are saying

  1. You can't call methods from objects that are null in C#/.NET (I do it in C++, it just doesnt access any member vars)
  2. Extension methods didn't exist in .NET 2.0
  3. Microsoft didn't bother to update the standards and probably felt it was insignificant
Edit
Report