Operators in VB.NET

Logical Operators

You can use logical operators to work with logical values ( true and false).

 

Operator

Description

Example

And

and

x=1 y=2

(x < 5 And y > 1) evaluated to true

Or

or

x=1 y=2

(x>2 Or y>1) evaluated to true

Not

not

x=1 y=2

Not(x=y) evaluated to true

Compound Operators

Operators can be combined together.

Operator

Example

The Same As

+=

x+=y

x=x+y

-=

x-=y

x=x-y

*=

x*=y

x=x*y

/=

x/=y

x=x/y

^=

x^=y

x=x^y

\

x\=y

x=x\y

 

String concatenation operator (&)

In VB.NET, & sign is used to concatenate strings or text.


Example:
Dim yourname As String
yourname="Yuk" &"Sovandara"





HTML Comment Box is loading comments...



This website intents to provide free and high quality tutorials, examples, exercises and solutions, questions and answers of programming and scripting languages:
C, C++, C#, Java, VB.NET, Python, VBA,PHP & Mysql, SQL, JSP, ASP.NET,HTML, CSS, JQuery, JavaScript and other applications such as MS Excel, MS Access, and MS Word. However, we don't guarantee all things of the web are accurate. If you find any error, please report it then we will take actions to correct it as soon as possible.