Skip to main content

Quick Reference for C# and VB

  • Default accessibility is public(Public in Visual Basic)

Type/Member Declaration

ShortcutDescriptionComment
_interface member declarationprefix
cclass declaration
coconstructor declaration
dedelegate declaration
enenum declaration
evevent declaration
ffield declaration
iinterface declaration
inindexer declaration
kconstant declaration
mmethod declaration
moModule declaration
pproperty declaration
rerecord declaration
ststruct declaration

Modifier

ShortcutDescriptionComment
aabstract (MustInherit)prefix (after access modifier)
dprotected (Protected)prefix
iinternal (Friend)prefix
pprivateprefix
rread-onlyprefix (after access modifier)
sstatic (Shared)prefix (after access modifier)
vvirtual (Overridable)prefix (after access modifier)

Statement

ShortcutDescriptionComment
feforeach statement
frfor statement
ifif statement
scSelect Case statement
swswitch statement
ttry statement
ththrow statement
uusing statement
wwhile statement

Operator

ShortcutDescriptionComment
copconditional operator
gtGetType operator
nnew object creation
nonameof operator
oooperator overload
texplicit cast operator
tcTryCast operator
totypeof operator
xlogical not operatorprefix

Type

ShortcutDescriptionComment
aArray
bBoolean
cCollection<T>
dDictionary<TKey,TValue>
dtDateTime
hsHashSet<T>
iImmutableprefix
iInt32
lList<T>
llLinkedList<T>
oObject
ocObservableCollection<T>
qQueue<T>
sStack<T>
sString

Other

ShortcutDescriptionComment
ccatch clause
ddefault keyword
eelse clause
ffinally clause
llambda expression
n(equals to) null
paparameter array
pppreprocessor directiveprefix
psprivate set
rreturn keyword
thiscontaining type name
vlocal variable declaration
xwith initializersuffix
yyieldprefix