G
Guest
Hi
I do like C# 2's new ?? operator, which enables us to code something like:
// Ensure someString is not null
someString = someString ?? "";
But wouldn't it make a lot of sense to take this a step further and allow a
shorthand-assignment equivalent (much like +=, -= and so on)? I.e instead of
what we have above, we could just say:
someString ??= "";
Now that would be nice...
Rich
I do like C# 2's new ?? operator, which enables us to code something like:
// Ensure someString is not null
someString = someString ?? "";
But wouldn't it make a lot of sense to take this a step further and allow a
shorthand-assignment equivalent (much like +=, -= and so on)? I.e instead of
what we have above, we could just say:
someString ??= "";
Now that would be nice...
Rich