Represent Int64 as a String in C#



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
Updated on: 2020-06-23T08:50:51+05:30

261 Views

Kickstart Your Career

Get certified by completing the course

Get Started
Advertisements