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

Samual Sam
Samual Sam

Learning faster. Every day.

Updated on: 23-Jun-2020

172 Views

Kickstart Your Career

Get certified by completing the course

Get Started
Advertisements