Convert value type to string : Convert to string : Data Type C# Examples


C# Examples » Data Type » Convert to string »

 

Convert value type to string









    
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());

    }                
}
    
   
  
   



Output

12
3.05
3.5
True


HTML code for linking to this page:

Follow Navioo On Twitter

C# Examples

 Navioo Data Type
» Convert to string