Logo Questions Linux Laravel Mysql Ubuntu Git Menu
 

What does operator ~= mean in Lua?

Tags:

operators

lua

What does the ~= operator mean in Lua?

For example, in the following code:

if x ~= params then 
like image 455
Alejandro Simkievich Avatar asked Jan 11 '16 02:01

Alejandro Simkievich


People also ask

What does ~= mean in code?

The operator ~= is exactly the negation of equality (==).

Does ~= mean not equal?

The ~ operator means logical negation, and the ~= operator means not equals.

What does operator mean in Lua?

An operator is a symbol that tells the interpreter to perform specific mathematical or logical manipulations. Lua language is rich in built-in operators and provides the following type of operators − Arithmetic Operators. Relational Operators.

What does ::= mean in Lua?

The ~= symbol or operator in Lua is known as the not-equal to operator.


2 Answers

the ~= is not equals

It is the equivalent in other languages of !=

like image 84
caulitomaz Avatar answered Sep 18 '22 11:09

caulitomaz


The operator ~= is exactly the negation of equality (==).

See docs.

like image 26
pushkin Avatar answered Sep 21 '22 11:09

pushkin