Seeing that ∅ is your choice for an empty value, for non-empty one you can just prepend it with the negation symbol: ¬∅, or !∅.
As far as UX goes, this will only be instantly clear to people who are familiar with logic symbols (or most developers in the case of !). Luckily, as each dropdown item has text to elucidate what each symbol means, and as it may be fair to assume that most users will be familiar with most other symbols, having a few cryptic symbols is not such a big deal - users will be aware of the contextual help served by the dropdown.
Given that, you may just as well make up something slightly more memorable, like ○ for empty, and ● for non-empty. It may not be based on logic notation, but will work all the same.
dropdown - What is the opposite symbol of "empty"? - User Experience Stack Exchange
Why the hate for null?
c# - What is the most concise way to write the opposite of a null coalesce - Stack Overflow
terminology - Is there a single word meaning 'not null'? - Stack Overflow
Seeing that ∅ is your choice for an empty value, for non-empty one you can just prepend it with the negation symbol: ¬∅, or !∅.
As far as UX goes, this will only be instantly clear to people who are familiar with logic symbols (or most developers in the case of !). Luckily, as each dropdown item has text to elucidate what each symbol means, and as it may be fair to assume that most users will be familiar with most other symbols, having a few cryptic symbols is not such a big deal - users will be aware of the contextual help served by the dropdown.
Given that, you may just as well make up something slightly more memorable, like ○ for empty, and ● for non-empty. It may not be based on logic notation, but will work all the same.
If the user is selecting this themselves/would naturally be going to the dropdown as a part of the user flow then I don't think the icon really matters at all. (~∅)? If they choose it then they already know what they are attempting to do.
Other suggestions "ev"/"nev".
Look, I get it: Null pointer exceptions are annoying but so is having to constantly check every object . against null. Is this the new religion after OOP and FP are being phased out? Null just means that the object is not initialized. It's useful to indicate such a state. If you just force yourself to initialize every object to some empty value then you're going to end up passing around empty strings - but wait, an empty string might intentionally be empty or it might indicate "please fill me".
Because I can already tell you what massive insights will come out soon: That null is actually not a mistake at all, it's useful. And the most ironic part about all this? These same people who hate on null are loving nullable types. Litearlly just types that *can be null but you just have to check every time before you use them*. So there is literally no difference except it forces you on a compiler level to check for null every time you use it. When I realized this I thought I was in dreamland, how can these people worship this meaningless little feature so much, crazy. It's literally the same as having null in the language except with a tiny tiny "advantage" that the compiler forces you to check. Which 99.9% of the time, you dont want to be forced because maybe you know implicitly and you dont care [right now].
Sneaky - you edited it while I was replying. :)
I do not believe there is a more concise way of writing that. However, I would use the "HasValue" property, rather than == null. Easier to see your intent that way.
int? k = !i.HasValue ? i : j;
(BTW - k has to be nullable, too.)
In C#, the code you have is the most concise way to write what you want.