
- C# Basic Tutorial
- C# - Home
- C# - Overview
- C# - Environment
- C# - Program Structure
- C# - Basic Syntax
- C# - Data Types
- C# - Type Conversion
- C# - Variables
- C# - Constants
- C# - Operators
- C# - Decision Making
- C# - Loops
- C# - Encapsulation
- C# - Methods
- C# - Nullables
- C# - Arrays
- C# - Strings
- C# - Structure
- C# - Enums
- C# - Classes
- C# - Inheritance
- C# - Polymorphism
- C# - Operator Overloading
- C# - Interfaces
- C# - Namespaces
- C# - Preprocessor Directives
- C# - Regular Expressions
- C# - Exception Handling
- C# - File I/O
- C# Advanced Tutorial
- C# - Attributes
- C# - Reflection
- C# - Properties
- C# - Indexers
- C# - Delegates
- C# - Events
- C# - Collections
- C# - Generics
- C# - Anonymous Methods
- C# - Unsafe Codes
- C# - Multithreading
- C# Useful Resources
- C# - Questions and Answers
- C# - Quick Guide
- C# - Useful Resources
- C# - Discussion
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); } }
- Related Articles
- How to convert a String into int in Java?
- How to convert hex string into int in Python?
- C++ Program to Convert int Type Variables into String
- How to convert an int to string in C++?
- How to convert a single char into an int in C++
- How to parse a string into a nullable int in C#?
- Golang Program to convert string type variables into int
- Haskell Program to convert string type variables into int
- How to convert int to String in java?
- How to convert int to string in Python?
- How to convert a String to an int in Java
- How to convert a string to int in Lua programming?
- C++ Program to convert int Variables into double
- How to convert a Java String to an Int?
- Convert int to String in Java

Advertisements