Converts various value types to string type - CSharp Language Basics

CSharp examples for Language Basics:Data Type Cast

Description

Converts various value types to string type

Demo Code

using System;//from   w  w w  .ja va2s .  com
class StringConversion {
   static void Main(string[] args) {
      int i = 1975;
      float f = 53.123f;
      double d = 2345.7654;
      bool b = true;
      Console.WriteLine(i.ToString());
      Console.WriteLine(f.ToString());
      Console.WriteLine(d.ToString());
      Console.WriteLine(b.ToString());
   }
}

Result


Related Tutorials