Code snippet shortcut
Press tab
twice to use code snippets
cw
-> Console.WriteLine();
props
String Format
C
orc
-> Currency
Console.WriteLine("{0:c}", 99999);
> $99,999.00
D
ord
-> Decimal numbers with padding
Console.WriteLine({0:d9}, 99999);
> 000099999
F
orf
-> Fixed-point with padding
Console.WriteLine({0:f3}, 99999);
> 99999.000
N
orn
-> Basic numerical formatting (with commas)
Console.WriteLine({0:n}, 99999);
> 99,999.00
E
ore
-> Exponential notation
Console.WriteLine({0:E}, 99999);
> 9.999900E+004
Console.WriteLine({0:e}, 99999);
> 9.999900e+004
X
orx
-> Hexadecimal
Console.WriteLine({0:X}, 99999);
> 1869F
Console.WriteLine({0:x}, 99999);
> 1869f
G
org
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