Operators Documentation

Here is a full list of comparison, mathematical, and special operators used in X3.

Comparison Operators

OperatorDescriptionExample
==Equal toif $a == $b
!=Not equal toif $a != $b
>Greater thanif $a > $b
<Less thanif $a < $b
>=Greater than or equalif $a >= $b
<=Less than or equalif $a <= $b

Removed Comparison operators

isChecks if two variables reference the same objectif $a is $b
is notChecks if two variables reference different objectsif $a is not $b
!=Strict inequality (not identical)if $a !== $b

String Operators

OperatorDescriptionExample
startswithChecks if a string starts with anotherif $text startswith "Hello"
containsChecks if a string contains anotherif $text contains "lo"
==icCase-insensitive equalityif $text ==ic "HELLO"
|+|String equality in percentageif ($a |+| $b)==50

Removed String operators

endswithChecks if a string ends with anotherif $text endswith "World"