CSharp examples for Language Basics:Data Type Format
Convert number to string with ToString method
using System;//from w ww. j a va 2 s . c o m using System.Collections.Generic; using System.Linq; using System.Text; using System.Threading.Tasks; class Program { static void Main(string[] args) { // Some number int number = 1234; // Conversion to text //string numberAsText = number; // DOES NOT WORK! string numberAsText = number.ToString(); // Output Console.WriteLine("Output of number: " + number); Console.WriteLine("Output of text: " + numberAsText); } }