tags:

views:

378

answers:

2

Difference between Convert.tostring() and .tostring().

I got many difference in web.But what is major reason?

+6  A: 

Convert handles null while ToString() doesnt.

Farstucker
good.. For this specific reason only they using. two methods?
Ayyappan.Anbalagan
Also, semi-related, see this answer for more detail: http://stackoverflow.com/questions/496096/casting-vs-using-the-as-keyword-in-the-clr/496167#496167
JYelton
+7  A: 

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.

Chris Dwyer