slice
功能說明
擷取字串中指定位置的部分內容,可指定起始索引與長度(可選)。索引從 0 開始,支援負數(從尾端開始)。
語法
{{ 字串 | slice: start }}
{{ 字串 | slice: start, length }}
範例
{{ "Liquid template" | slice: 0, 6 }}
Liquid
Updated 21 days ago
功能說明
擷取字串中指定位置的部分內容,可指定起始索引與長度(可選)。索引從 0 開始,支援負數(從尾端開始)。
語法
{{ 字串 | slice: start }}
{{ 字串 | slice: start, length }}
範例
{{ "Liquid template" | slice: 0, 6 }}
Liquid
Updated 21 days ago