What is difference between Convert.ToString(variable) and
variable.ToString()

Answer Posted / sanjib ghosh

Dim salary As Int16
Dim oldSalary As String = salary.ToString()
Dim newSalary As String = Convert.ToString(salary)
MsgBox(oldSalary & "")
MsgBox(newSalary & "")
''No exception throw

both work same function

Is This Answer Correct ?    0 Yes 0 No



Post New Answer       View All Answers


Please Help Members By Posting Answers For Below Questions

How to override a function in c#?

547


How do generics work in c#?

488


What is verbatim string literal in c#?

471


Why is aws serverless?

501


What is an indexer in c#?

547






What is the usage of OLE?

588


Tell me the difference between value passing and address passing?

631


How do I unload an application domain?

526


What's c# ?

594


What is type cast in C#?

565


What is new method in c#?

527


What are get and set in c#?

583


What is the difference between CreateObject() and GetObject()?

557


In c#, what will happen if you do not explicitly provide a constructor for a class?

523


What are reflections in c#?

489