Represent Int64 as a String in C#

CsharpProgrammingServer Side Programming

Int64 represents a 64-bit signed integer. To represent it as a string, use the ToString() method.

Firstly, declare and initialize an Int64 variable.

long val = 8766776;

Now, represent it as a string.

val.ToString()

Let us see the complete example.

Example

 Live Demo

using System;
class Demo {
   static void Main() {
      long val = 8766776;
      Console.Write("Long converted to string = "+val.ToString());
   }
}

Output

Long converted to string = 8766776
raja
Published on 14-Sep-2018 13:20:39
Advertisements