If objects contains null or empty then how to validate or check the condition for the same?
How to bool check whether object obj is null or
null
Following code could be a safer way of achieving it.
if(obj != null && !string.IsNullOrEmpty(obj.ToString())) { }
This code saves us from object being a non-string type.