PHP Developers Network

A community of PHP developers offering assistance, advice, discussion, and friendship.
 
Loading
It is currently Thu Nov 23, 2017 12:25 am

All times are UTC - 5 hours




Post new topic Reply to topic  [ 3 posts ] 
Author Message
 Post subject: Difference
PostPosted: Wed Dec 09, 2015 7:07 am 
Offline
Forum Newbie

Joined: Sat Nov 14, 2015 4:30 am
Posts: 1
What is the difference between Convert.toString and .toString() method actually I am learning coding that's why asking these basic questions.


Top
 Profile  
 
 Post subject: Re: Difference
PostPosted: Wed Dec 09, 2015 9:37 am 
Offline
Site Administrator
User avatar

Joined: Wed Aug 25, 2004 7:54 pm
Posts: 13447
Location: New York, NY, US
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.

_________________
(#10850)


Top
 Profile  
 
 Post subject: Re: Difference
PostPosted: Tue Feb 09, 2016 6:10 am 
Offline
Forum Newbie

Joined: Thu Feb 04, 2016 2:19 am
Posts: 7
Hey,
Convert.ToString() handles null, while ToString() doesn't.


Top
 Profile  
 
Display posts from previous:  Sort by  
Post new topic Reply to topic  [ 3 posts ] 

All times are UTC - 5 hours


Who is online

Users browsing this forum: No registered users and 3 guests


You cannot post new topics in this forum
You cannot reply to topics in this forum
You cannot edit your posts in this forum
You cannot delete your posts in this forum
You cannot post attachments in this forum

Jump to:  
Powered by phpBB® Forum Software © phpBB Group