obj1 != null
- the right way.
The string defines IsNullOrEmpty as the best way to say
obj1 == null || obj == String.Empty
therefore, he does more than just check for absence.
There may be other classes that define a method for checking the semantically "empty or null" object, but this will depend on the semantics of the class and by no means universally.
It is also possible to create an extension method to do this if it helps the readability of your code. For example, a similar approach to collections:
public static bool IsNullOrEmpty (this ICollection collection) { return collection == null || collection.Count == 0; }
source share