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 341 of 397Using the C# Range Operator
c# range operator: Learn how the C# range operator works for slicing arrays, strings, and collections, including syntax, edge cases, and performance considerations.
Using C# Memory Slice for Efficient Data Access
c# memory slice: Learn how to use Slice on Memory<T> and ReadOnlyMemory<T> in C# to share data ranges without copying or allocating new arrays.
C# Span vs Memory: Choosing the Right Type
c# span vs memory: Learn when to use Span<T> and when to use Memory<T> in C#. Understand stack-only constraints, async limitations, streaming scenarios, and practical...
C# Memory vs ReadOnlyMemory: Choosing the Right Type
Understand the difference between Memory<T> and ReadOnlyMemory<T> in C#, when to use each, and how they relate to Span<T> for efficient buffer handling.
C# Memory Usage: Diagnosing and Reducing Allocations
Practical techniques for profiling C# memory usage, reducing allocation hotspots, reusing buffers, and avoiding common GC traps.
C# Memory vs Span: Choosing the Right Approach
c# memory vs span: Understand the differences between Memory<T> and Span<T> in C#, including when to use each, their runtime behavior, and practical guidance for high-...
Using C# Span with Stackalloc for Zero-Allocation Buffers
Learn how to use C# Span<T> with stackalloc for zero-allocation temporary buffers: syntax, constraints, practical examples, and when to avoid stack allocation.
Using C# stackalloc for High-Performance Buffers
Learn how to use c# stackalloc to allocate buffers on the stack, avoid heap allocations, and improve performance in high-frequency code paths.
Slicing Spans in C#
Learn how to use Span<T>.Slice to create memory views without allocations, with practical examples and performance considerations.
Using ReadOnlySpan in C# for Slicing and Validation
ReadOnlySpan in C# enables allocation-free slicing and validation of strings and buffers. Includes practical parsing examples, ref struct restrictions, and performance trade-offs.