.NET Core API Documentation

Int32 System
Represents a 32-bit signed integer.

The System.Int32 value type represents integers that range from negative 2,147,483,648 (-2^31) through positive 2,147,483,647 (2^31 - 1).

Class Members

Syntax

C#
public struct Int32 : IComparable, IComparable<int>, IConvertible, IEquatable<int>

Remarks

The Int32 type is a value type that represents whole numbers. It is the most commonly used integer type in .NET.

You can perform standard arithmetic operations on Int32 values, such as addition, subtraction, multiplication, and division.

When you perform operations that result in a value outside the range of Int32, an overflow occurs. You can use methods like checked and unchecked to control overflow behavior.

For example, to convert a string to an Int32, you can use the Int32.Parse method:

string numberString = "123";
int number = Int32.Parse(numberString);