alias
itoa() (C)
alias lang_id
c
how to
convert integer to string
lang_id
csharp
qid
29002

How to
itoa() (C) in C#

Redirected to “convert integer to string

Use Int32.ToString() method.

using System;

class Program
{
    static void Main()
    {
        int x = -3;
        string s = x.ToString();
        Console.WriteLine(s); // -3
    }
}

Use Convert.ToString(Int32) method.

using System;

class Program
{
    static void Main()
    {
        int x = -3;
        string s = Convert.ToString(x);
        Console.WriteLine(s); // -3
    }
}
Select default language: