
Data Structure
Networking
RDBMS
Operating System
Java
MS Excel
iOS
HTML
CSS
Android
Python
C Programming
C++
C#
MongoDB
MySQL
Javascript
PHP
- Selected Reading
- UPSC IAS Exams Notes
- Developer's Best Practices
- Questions and Answers
- Effective Resume Writing
- HR Interview Questions
- Computer Glossary
- Who is Who
C# Program to Convert String to Long
To convert a string to a long, use the Long.parse method in C# −
Firstly, set a string −
string str = "6987646475767";
Now, convert it to long −
long.Parse(str);
Here is the complete code −
Example
using System; using System.Linq; class Demo { static void Main() { string str = "6987646475767"; long res = long.Parse(str); Console.WriteLine(res); } }
Output
6987646475767
Advertisements