Visual Basic comes with many built-in operators that allow us to manipulate data. An operator performs a function on one or more operands. For example, we add two variables with the "+" addition operator and store the result in a third variable with the "=" assignment operator like this: int x + int y = int z. The two variables (x ,y) are called operands. There are different types of operators in Visual Basic and they are described below in the order of their precedence.
Arithmetic operators are used to perform arithmetic operations that involve calculation of numeric values. The table below summarizes them:
|-||Negation (used to reverse the sign of the given value, exp -intValue)|
Concatenation operators join multiple strings into a single string. There are two concatenation operators, + and & as summarized below:
A comparison operator compares operands and returns a logical value based on whether the comparison is true or not. The table below summarizes them:
|>=||Greater than or equal to|
|<=||Less than or equal to|
Logical / Bitwise Operators
The logical operators compare Boolean expressions and return a Boolean result. In short, logical operators are expressions which return a true or false result over a conditional expression. The table below summarizes them:
VB.Net Operators OR / And / Not Equal ....
<> Tests whether two values are not equal.
< Tests whether the first value is less than the second value.
> Tests whether the first value is greater than the second value.
<= Tests whether the first value is less than or equal to the second value.
>= Tests whether the first value is greater than or equal to the second value.