Code snippet shortcut
Press tab twice to use code snippets
cw -> Console.WriteLine();
props
String Format
Corc-> Currency
Console.WriteLine("{0:c}", 99999);
> $99,999.00
Dord-> Decimal numbers with padding
Console.WriteLine({0:d9}, 99999);
> 000099999
Forf-> Fixed-point with padding
Console.WriteLine({0:f3}, 99999);
> 99999.000
Norn-> Basic numerical formatting (with commas)
Console.WriteLine({0:n}, 99999);
> 99,999.00
Eore-> Exponential notation
Console.WriteLine({0:E}, 99999);
> 9.999900E+004
Console.WriteLine({0:e}, 99999);
> 9.999900e+004
Xorx-> Hexadecimal
Console.WriteLine({0:X}, 99999);
> 1869F
Console.WriteLine({0:x}, 99999);
> 1869f
Gorg
Verbatim Strings
Prefix a string with@, you can have the string as it is.
1 | Console.WriteLine(@"C:\MyApp\bin\Debug") |
Datetime
DateTime dt = new DateTime(1995, 2, 2);
Conditions
Switch
1 | switch(choice) |
Interface
as returns reference or null
is returns true or false