速记不为空C#

soa*_*ing 2 c# c#-4.0

有可能像这样做一个有条件的非空吗?

object e = !string.IsNullOrEmpty(c) ?? d;
Run Code Online (Sandbox Code Playgroud)

它有可能吗?

Jet*_*hro 8

你可以试试下面的.

object e = !String.IsNullOrEmpty(c) ? c : d;
Run Code Online (Sandbox Code Playgroud)