If statement question...

Hello. When I am making conditions for something to have, rather than have the condition be something like equal to or greater than, is there any way I can have a condition happen if the value is anything but a specific value?

So instead of this

if(Variable==2){something}

it would be

if(Variable does not equal 1){something}

You can use != for that