Page 1 of 1
Difference
Posted: Wed Dec 09, 2015 6:07 am
by DennisManley
What is the difference between Convert.toString and .toString() method actually I am learning coding that's why asking these basic questions.
Re: Difference
Posted: Wed Dec 09, 2015 8:37 am
by Christopher
Convert is a system object that provides many methods to convert variables from one type to another. The .toString() method is available in some object types to return the contents of the object as a string. The main practical difference is that .toString() has to be called on an object, whereas you can pass Convert.toString() a variable that cannot be converted to a string or is null.
Re: Difference
Posted: Tue Feb 09, 2016 5:10 am
by Swhite
Hey,
Convert.ToString() handles null, while ToString() doesn't.