The opposite of "contains"

With regards to the programming context mentioned elsewhere, you can use terms such as "absent" or "missing" as in:

Assert.Absent( ... )

Assert.Missing( ... )

These seem highly likely to confuse whoever needs to read your code next, however, since no one will be searching for these terms. Contains is an extremely well adopted term for checking containers for objects. NotContains (from one of your comments) will at least match a query for "Contains".

In short: The terms exist but I wouldn't use them.


I think "lacks" is the word you seek.

This beer lacks alcohol.