- Data Structure
- Networking
- RDBMS
- Operating System
- Java
- MS Excel
- iOS
- HTML
- CSS
- Android
- Python
- C Programming
- C++
- C#
- MongoDB
- MySQL
- Javascript
- PHP
- Physics
- Chemistry
- Biology
- Mathematics
- English
- Economics
- Psychology
- Social Studies
- Fashion Studies
- Legal Studies
- Selected Reading
- UPSC IAS Exams Notes
- Developer's Best Practices
- Questions and Answers
- Effective Resume Writing
- HR Interview Questions
- Computer Glossary
- Who is Who
How to convert a string into int in C#?
Let’s say our string is −
string str ="9999";
Now, use the Int32.Parse() to convert the string into integer −
int n = Int32.Parse(str);
Now display the integer value as shown in the following code −
Example
using System; class Demo { static void Main() { string str ="9999"; int n = Int32.Parse(str); Console.WriteLine(n); } }
Advertisements