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.
文字列変数がnullか空か、Twigでスペース文字でいっぱいかどうかを確認するにはどうすればよいですか? (可能な限り最短、おそらく CSharp のString.IsNullOrWhiteSpace()方法と同等)
String.IsNullOrWhiteSpace()
私はむしろトリムと空だけを使いたい:
{% if foo|trim is empty %} {% if foo|trim is not empty %}
foo変数が次の場合、 emptyは true と評価されます