All syntax guides
Short, practical guides on programming syntax, language fundamentals, and the tools developers reach for every day.
3,965 guides across 14 topics
Topics
Popular guides
Most readLatest guides
Page 336 of 397C# String to Char Array: Using ToCharArray
c# string to char array: Convert a C# string to a char array with ToCharArray, handle edge cases, and understand when an array is the right choice.
C# String Replace: Syntax, Overloads, and Performance
Learn how to use C# string.Replace, including string and character overloads, all-occurrence behavior, case sensitivity, performance tradeoffs, and when to choose Regex or StringBuilder.
C# foreach Loop: Syntax, Behavior, and Performance
c# foreach loop: Learn how to use the C# foreach loop to iterate over collections, understand its runtime behavior, avoid common pitfalls, and know when to choose it o...
C# Switch Default: When No Case Matches
Understand when the C# switch default case runs, how to use it in switch statements and switch expressions, and how to avoid common pitfalls.
C# Switch Case: Syntax, Patterns, and Pitfalls
Learn C# switch case syntax, switch expressions, pattern matching, common mistakes, and performance considerations for clean control flow.
C# Null Coalescing Assignment Operator
c# null coalescing assignment operator: Learn how to use the C# null coalescing assignment operator (??=) to assign values only when a variable is null, with practical...
C# Modulo Operator: Syntax and Common Pitfalls
A practical look at the C# modulo operator: integer and floating-point behavior, negative operands, common pitfalls, and useful code examples.
C# Arithmetic Operators: Syntax, Behavior, and Pitfalls
How C# arithmetic operators behave in practice: integer division truncation, overflow handling, floating-point precision limits, and operator precedence.
C# Overflow Handling with checked and unchecked
How C# handles integer overflow by default, how the checked and unchecked contexts change that behavior, and how to enable project-wide overflow checking.
C# Convert Usage: Converting Between Base Types
How to use the C# Convert class for type conversion, including null and DBNull handling, culture behavior, and when to choose Convert, Parse, TryParse, or casting.