14
Reply

What is the difference between Convert.ToString() and .ToString()?

Brajesh Kumar

Brajesh Kumar

Jan 13, 2017
4.8k
4

    can you Explain with a program

    Vickey Kumar
    February 24, 2017
    3

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

    Brajesh Kumar
    February 25, 2017
    2

    Convert.ToString() handles null, while ToString() doesn't. explanation with C# Code.............. Un Safe code ...................................Try' In this code we will get "Object reference not set to an instance of an object." exceptionDim a As Objecta = Nothinga.ToString()Catch ex As NullReferenceExceptionResponse.Write(ex.Message)End Try'............... it is a safe code..............................Dim b As Objectb = NothingConvert.ToString(b)

    Brajesh Kumar
    January 13, 2017
    2

    Convert.ToString() handles null value but .ToString() does not handle null value. Example:-string str; object i = null; str = i.ToString();------>It Throws errorstring str; object i = null; str = Convert.ToString(i);-->It does not throgh error

    Rameshyadav Medaboina
    November 15, 2017
    1

    Convert.ToString() handles null value but .ToString() does not handle null value.

    Sudheshwer Rai
    June 01, 2017
    1

    Convert.ToString() handles null .ToString() not handles null

    Ashish Srivastava
    January 10, 2018
    0

    Convert.ToString() handles null .ToString() not handles null

    Ashish Srivastava
    January 10, 2018
    0

    Convet.ToString() will handle null values and ToString not

    Suresh Kumar
    October 28, 2017
    0

    Convet.ToString() will handle null values and ToString not

    Suresh Kumar
    October 28, 2017
    0

    Convet.ToString() will handle null values and ToString not

    Suresh Kumar
    October 28, 2017
    0

    Convet.ToString() will handle null values and ToString not

    Suresh Kumar
    October 28, 2017
    0

    Convet.ToString() will handle null values and ToString not

    Suresh Kumar
    October 28, 2017
    0

    Convet.ToString() will handle null values and ToString not

    Suresh Kumar
    October 28, 2017
    0

    Convert executes before statement

    Mukesh Kumar
    September 02, 2017
    0