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

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: 2026-03-11T22:50:43+05:30

328 Views

Kickstart Your Career

Get certified by completing the course

Get Started
Advertisements