選擇第一個字符串,我需要什麼:如何嫩枝
我從字符串只需要名字。
Like String : Bodo Jorg Udo .. (i have .. notation if string of length is more then 20).
這裏是源代碼
{%if item.metadata.name |length < 20 %} {{item.metadata.name}} {%else%}{{WordLimit(item.metadata.name,10,10)}} .. {%endif%}
輸出應該像
Bodo
拆分後的廣告d第一個過濾器,它會給你你的名字。 '{%set yourVariable = yourString | split('')| First()%}' – kodvin 2014-09-08 13:53:32