C# — Command Reference
C#'s most used commands and methods — each with an explanation, working example, and real-world usage. The language of .NET applications, games (Unity), and the web (ASP.NET).
7 categories · 16 commands
🖥️
Output
Printing to the console and string interpolation.
Console.WriteLine()String interpolation ( $ )📦
Variables & Types
var, const, and type conversion.
var / constint.Parse() / ToString()🔢
Numbers & Math
Operators and the Math class.
Math operatorsMath.Sqrt() / Math.Pow() / Math.Abs()✍️
String
Length, casing, searching, replacing, and splitting.
.Length / .ToUpper().Contains() / .Replace().Split() / string.Join()📚
List & Dictionary
List<T> and Dictionary<K,V>.
List<T>Dictionary<K,V>🔀
Condition & Loop
if/else, for, foreach, and while.
if / elsefor / foreachwhile🧩
Function
Local functions, return, and the arrow (=>).
Local functionArrow function ( => )