0% found this document useful (0 votes)
6 views5 pages

Csharp Cheatsheet

This document is a quick reference guide for C# programming, covering basic syntax, data types, and methods. It includes examples of compiling and running code, variable declarations, control structures, and string manipulation. Additionally, it provides definitions of key terms related to the Common Language Runtime and managed code.

Uploaded by

Marznafri Yagami
Copyright
© © All Rights Reserved
We take content rights seriously. If you suspect this is your content, claim it here.
Available Formats
Download as PDF or read online on Scribd
0% found this document useful (0 votes)
6 views5 pages

Csharp Cheatsheet

This document is a quick reference guide for C# programming, covering basic syntax, data types, and methods. It includes examples of compiling and running code, variable declarations, control structures, and string manipulation. Additionally, it provides definitions of key terms related to the Common Language Runtime and managed code.

Uploaded by

Marznafri Yagami
Copyright
© © All Rights Reserved
We take content rights seriously. If you suspect this is your content, claim it here.
Available Formats
Download as PDF or read online on Scribd
You are on page 1/ 5
578/25, 12:41 PM QuickRefME C# (Of Cheat Shot & Quick Reference Q Osters (CH quick reference cheat sheet that provides basic syntax and methods, # Getting Started class Hello { 1 wain nethoe static void main(steingl] args) t 1/ output: Hello, world! Console.tiriteLine(“Hello, world!"); ? Compiling and running (make sure you are in the project directory) $ dotnet run Hello, world! Inaps:quiekref moves. int 82k 1s 578/25, 12:41 PM int SntNum Long JongNun = 9999999; Float Floats = 9,99F; Gouble dovblewun = 99.995; ecinal decinalNum = 99.9999; char Letter = °D°; bool @bool = true; string site = “quickref.ne"; var mun = 9995 var str = "388"; var bo = falses Data Type Size int A bytes rong Bytes float A bytes double bytes decimal 1ebytes char 2 bytes boot 1 bit seeing 2 bytes per char 11 Single-Line conment J multi-line connent */ 1/1000: Adds conment to a task List in Visual Studio, J// Single-Line comment: used for documentation (/** MultL-Line conment used for documentation **/ 11 steing concatenation string nane Console. Kr: first +7" + lasty Lime(nane); // => John Doe Inaps:quiekref moves. int ‘OF Cheat Shoot & Quick Refer Rene 24 2810 20.4 6°°7 decimal digits 15 decimal digits 28° 29 decimal digits 0 65535 true false WA 578/25, 12:41 PM ‘Of Cheat Shoot & Quick Reference console. Line("Enter number"); Af (Int. TryParse(Console.ReadLine(),out int Anput)) 4 11 Input validated Console.writeLine($"¥ou entered (Enput}")s ? int j= 185 if G == 18) ¢ Console.kriteLine(“I get printed"); } else if (J > 10) ¢ Console.kriteLine("I don’t"); } else ¢ Console.writeLine("I also don't"); ? char{] chars = new char{1e]; cchars{o] = *2"5 chars(1) string[] levters = CA", "8", "Cs Ant[] mylist = (100, 200); bool] answers = (true, false); Ant] numbers = (2, 2 3, 4, 5} for(int £ = 8; 4 < nunbers.Length; $44) ¢ Console.riteLine(nunbers[i]); ? Foreach(int eum in numbers) Console.writeLine( nun); ? # C# Strings string last = Intps:quickref moves. hint 1578/25, 12:41 PM ‘Of Cheat Shoot & Quick Reference string first = “John; string last = "Doe" string name = $"(First) {last)"s Console.kriteLine(nane); // => John Doe Member Destsiption Length A property that returns the length ofthe string, compare) A static method that compares twa strings Containst Determines if the string contains a specific substring Equals) Determines if the two strings have the same character data Format) Formatsa string via the (0) notation and by using other primitives Removes all instances of specific characters from trailing and leading characters, Defaults to removing leading and trailing imo spaces. sono Removes the provided character and creates an aray out ofthe remaining characters on ether sce string longString = @"T can type any characters in here !WESR*&*()_+ '' \n \t except double quotes and T will be taken Literally. 1 even work with multiple Lines."5 eter exam 11 Using property of Systen. String string lengthofstring = "How Tong?’ sengthorString. Length W998 1/ Using methods of Systen.string dengthorString.Contains("Hon"); // => teue # Misc Tem Definition Runtime ‘Acollection of services that are required to execute a given compiled unt of code. Primarily locates londs, and managed NET objects. The CLR also handles memory management, ‘Common Language Runtime (CLR) ication hasting, coordination of threads, performaing security checks, and other low-level details, Managed code CCode that compiles and runs on NET runtime, C#/F#/VB are examples Intps:quiekref moves. int 46 578/25, 12:41 PM Term Related Cheatsheet Java Cheatsheet Quick Reference Recent Cheatsheet Remote Work Revolution Cheatsheet Quick Reference PyTorch Cheatsheet vik Reference Intps:quiekref moves. int (Of Cheat Shot & Quick Reference Homebrew Cheatsheet Quick Reference Taskset Cheatsheet Quick Reference (© 2025 QuickRef ME, All rights reserved Definition

You might also like

pFad - Phonifier reborn

Pfad - The Proxy pFad of © 2024 Garber Painting. All rights reserved.

Note: This service is not intended for secure transactions such as banking, social media, email, or purchasing. Use at your own risk. We assume no liability whatsoever for broken pages.


Alternative Proxies:

Alternative Proxy

pFad Proxy

pFad v3 Proxy

pFad v4 Proxy