Find centralized, trusted content and collaborate around the technologies you use most.
Teams
Q&A for work
Connect and share knowledge within a single location that is structured and easy to search.
这就是我想做的:
string x = if(true) "String Val" else "No String Val";
那可能吗?
您所说的称为条件语句:
string x = boolVal ? "String Val" : "No String Val";
如果您真的希望字符串在 bool 为 false 时没有值,您可以更改为:
string x = boolVal ? "String Val" : null;
string x = condition ? trueValue : falseValue;
http://msdn.microsoft.com/en-us/library/ty67wk28.aspx
我有一个“日期时间”列,如下所示:2012-06-04 15:40:20.
2012-06-04 15:40:20
我想在 Doctrine 中创建一个查询,以获取以前的数据。小于2012-06-04 15:40:20。我怎么能在教义中意识到这一点。
对不起,我只是不知道。