mar*_*c_s 2 c# asp.net dotliquid
我在我的ASP.NET 4.0 Webforms应用程序中使用DotLiquid作为一些电子邮件模板,并且我试图排除我的一个电子邮件模板的某个部分,如果数据对象中的给定字符串我绑定到模板为空或空.
检查NULL非常有效:
{% if MyString != null %}
Some fancy label: {{ MyString }}
{% endif %}";
Run Code Online (Sandbox Code Playgroud)
但是,无论我试图在此测试中包含空字符串到目前为止都失败了:
{% if MyString != null or MyString == empty %}
{% if MyString != null or MyString == '' %}
Run Code Online (Sandbox Code Playgroud)
如何检查"如果此字符串为空或空"?
| 归档时间: |
|
| 查看次数: |
4325 次 |
| 最近记录: |