C# code examples
6 short, tested snippets. Pick one to see the code with notes, or search Zest for something specific, such as “csharp read a file”.
- Read a filestring text = File.ReadAllText("data.txt");
- LINQ: Where and Selectvar names = users
- HTTP GET with HttpClientusing var http = new HttpClient();
- Record and classpublic record Point(int X, int Y);
- try / catchtry
- Hello worldConsole.WriteLine("Hello, World!");