Int32.Parse — converting text to int
Int32.Parse converts numeric text to int. Learn its default format rules, how culture affects parsing, and which exceptions invalid input produces.
CKTIS / C#
Programming syntax, operators and concepts. Find an explanation, explore an example and return to learning.
Int32.Parse converts numeric text to int. Learn its default format rules, how culture affects parsing, and which exceptions invalid input produces.
INumber<T> lets you write one generic method for different numeric types. Its constraint exposes operators and the inherited T.Zero and T.CreateChecked members, allowing you to initialize an accumulator and convert input values.
JsonException from System.Text.Json signals invalid JSON, an exceeded nesting limit, or a value incompatible with the target type. It also exposes diagnostic information that helps locate the problem in the input.
JsonTokenType is an enumeration in System.Text.Json describing a token recognized by Utf8JsonReader. It distinguishes object and array boundaries, property names, and values. None means the state before reading, not the JSON value null.
System.Collections.Generic.KeyNotFoundException signals an attempt to retrieve an element using a key that does not exist. Learn how Dictionary<TKey,TValue> indexer reads differ from writes and when to use TryGetValue for an expected missing key.
KeyValuePair<TKey,TValue> holds one key and one value of specified types. Its Key and Value properties are read-only; you encounter this type, for example, when iterating over Dictionary<TKey,TValue>.
MidpointRounding specifies a rounding rule. ToEven and AwayFromZero both choose the nearest result, but resolve values exactly halfway between two possible results differently.
System.Threading.Monitor combines mutual exclusion with waiting for shared state to change. Enter and Exit manage the lock, TryEnter can bound acquisition waiting, and Wait, Pulse, and PulseAll coordinate threads.
System.Collections.IEnumerable exposes iteration without specifying an element type through a generic parameter. Its GetEnumerator() method returns IEnumerator, and foreach reads elements through this contract.
System.Collections.IEnumerator describes a cursor for sequentially reading elements. It exposes MoveNext(), an object-valued Current, and Reset(); it is not a collection and does not guarantee IDisposable support.
NotNullWhenAttribute describes the relationship between a method's bool result and an argument's null-state. It lets nullable analysis recognize the safe branch after a checking method or a Try*-style method, without using the ! operator.
System.NullReferenceException signals an attempt to dereference null, such as reading a property on an object that does not exist. Learn the cause, the role of nullable analysis, and the difference between !, ?., and ??.
NumberFormatInfo supplies rules for formatting and parsing numbers, including separators and currency symbols. Learn its core methods, the distinction between current and invariant settings, and how to create a custom configuration safely.
OperationCanceledException signals that an operation was canceled. Learn how it works with CancellationToken, what ThrowIfCancellationRequested() does, and how requesting cancellation differs from acknowledging it.
BindingFlags controls which type members reflection searches for. Combine visibility and member-kind flags with |, and use DeclaredOnly to exclude inherited members.
RegionInfo in System.Globalization exposes information about a country or region. Its RegionInfo.ISOCurrencySymbol property returns a three-letter ISO 4217 currency code, such as USD, rather than a currency sign such as $.
String.Join combines elements into one string, inserting a separator between them. Null values are not skipped.
System.Action represents a parameterless operation that returns void. The Action<T> variant accepts one argument. Both types let you store and pass behavior, such as a method that prints a message, without declaring a custom delegate type.
System.Activator: practical reference: Activator.CreateInstance creates an instance of a type selected at run time through an available constructor.
System.ArgumentException: practical reference: ArgumentException denotes a non-null argument that violates the contract and can retain its ParamName.
System.ArgumentNullException: practical reference: ArgumentNullException specializes the error for a required argument that is null; ThrowIfNull retains the expression name.
System.Attribute: practical reference: Attribute is the base for metadata attached to types and members and read through reflection.
System.Buffers.ArrayPool: practical reference: ArrayPool<T> rents an array whose length is at least the requested size and requires Return.
System.Buffers.IBufferWriter: practical reference: IBufferWriter<T> exposes writable storage through GetSpan or GetMemory, while Advance commits the exact number of elements written.