• Saves Valuable Time
  • Trusted Accuracy for 12 Years
  • 15-Day Money-Back Guarantee

C# and VB Operator Comparison

VB C#
+, -, *, >, >=, <, <=, <<, >>
&    (string concatenation)
()    (indexing)
And
Or
AndAlso
OrElse
Not
Xor
Mod
x ^ y
=
Is
IsNot
<>
If(x, y, z)
If(x, y)
x / y    (where x and y are integers)
x / y    (where x and y are doubles)
x \ y    (where x and y are integers)
x \ y    (where x and y are doubles)
unchanged
+    (string concatenation)
[]
&
|
&&
||
! or ~    (depending on context)
^
%
Math.Pow(x, y) (no exponentiation operator)
= or ==    (depending on context)
==
!=
!=
x ? y : z
x ?? y
x / (double)y
x / y
x / y
Convert.ToInt32(x) / Convert.ToInt32(y)


Use Instant C# and Instant VB to convert between VB.NET and C#.     

Additional resource: VB.NET and C# Equivalents


Copyright © 1997 – 2017 Tangible Software Solutions Inc.