模板:Str left/doc
跳转到导航
跳转到搜索
| File:Edit-copy green.svg | 此页面是Template:Str left的模板文档。 此页面可能包含了模板的使用说明、分类和其他内容。 |
本模板用于截取字符串的前n个字符。
使用方式[编辑]
{{Str left|<文字串>|<字數>}}
|1=— 待截取的字符串|2=— 截取的字数(默认为1)
例子[编辑]
{{Str left|底事昆仑倾砥柱?九地黄流乱注,聚万落千村狐兔!|7}}→底事崑崙傾砥柱{{Str left|一二三四五}}→一
模板数据[编辑]
<templatedata> { "description": "显示一串文字中的前几个字", "params": { "1": { "label": "文字串", "description": "需要计算字数裁切的文字内容", "required": true, "type": "string" }, "2": { "label": "长度", "description": "希望显示的字数", "required": true, "type": "number" } } } </templatedata>