Convert value type to string : Convert to string « Data Type « C# / CSharp Tutorial






using System;


class MainClass
{
  static void Main(string[] args)
  {
    int num1 = 12;
    float num2 = 3.05f;
    double num3 = 3.5;
    bool bl = true;

    Console.WriteLine(num1.ToString());
    Console.WriteLine(num2.ToString());
    Console.WriteLine(num3.ToString());
    Console.WriteLine(bl.ToString());

  }        
}
12
3.05
3.5
True








2.52.Convert to string
2.52.1.Convert value type to string
2.52.2.Convert value type to string in string concatenation