Difference between Convert.ToString() and .ToString()
Convert.ToString()
handles null
, while ToString()
doesn't.
Calling ToString()
on an object presumes that the object is not null (since an object needs to exist to call an instance method on it). Convert.ToString(obj)
doesn't need to presume the object is not null (as it is a static method on the Convert class), but instead will return String.Empty
if it is null.