Different Between Convert.ToString() And .ToString() Method.

What is the difference between
Convert.toString() and .toString() method ?


Just to give an understanding of what the above question means see the below code.

int i =0; 
MessageBox.Show(i.ToString()); 
MessageBox.Show(Convert.ToString(i)); 


We can convert the integer “i” using “i.ToString()” or “Convert.ToString” so what is the 
difference. The basic difference between them is “Convert” function handles NULLS while 
“i.ToString()” does not it will throw a NULL reference exception error. So as a good coding 
practice using “convert” is always safe. . .

No comments:

Post a Comment

360 Virtual Tour 3D VR 360 Walkthrough Matterport The One Spa Abu Dhabi

360 Virtual Tour 3D VR 360 Walkthrough Matterport The One Spa Abu Dhabi Other videos with more in depth information about virtual tour creat...

Share now

Popular