In this article I will explain differences between .tostring() and Convert.tostring() in asp.net.
//Returns a null reference
exception for str.
string str;
object i = null;
str = i.ToString();
//Returns an empty string for str
and does not throw an exception. If you dont
string str;
object i = null;
str = Convert.ToString(i);
|
|
If you enjoyed this post, please support the blog below. It's FREE! Get the latest Asp.net, C#.net, VB.NET, jQuery, Plugins & Code Snippets for FREE by subscribing to our Facebook, Twitter, RSS feed, or by email. |
|||
Subscribe by RSS
Subscribe by Email
|
|||
|
|
Subscribe by RSS
Subscribe by Email
9 comments :
Nice
Suresh Your c# articles are just awesome.
That was a helpful article!
Easy to understand articles.....Thank u suresh
good
good one...
Ur site is enough to understand .net,sql,javascript etc...
and also enough to prepare for interview... once i went through ur site forgot to use other sites .... :) thanks a lot....