跳转到内容

Template:Str rightc:修订间差异

计算器百科,非营利的计算器专业知识百科。
春上冰月留言 | 贡献
创建页面,内容为“<includeonly>{{#if:{{{1|}}}|<!--if param. 1 not empty-- --then extract substring-->{{Str sub long|nocategory={{{nocategory|}}}|{{{1}}}|{{max|0|{{#expr:{{Str len|noca...”
 
Lch留言 | 贡献
导入1个版本
 
(未显示另一用户的1个中间版本)
第1行: 第1行:
<includeonly>{{#if:{{{1|}}}|<!--if param. 1 not empty--
<includeonly>{{safesubst:#switch:{{safesubst:#if:{{{1|}}}|a}}{{safesubst:#iferror:{{safesubst:#ifexpr:{{{2|}}}>0|b}}|c}}
--then extract substring-->{{Str sub long|nocategory={{{nocategory|}}}|{{{1}}}|{{max|0|{{#expr:{{Str len|nocategory={{{nocategory|}}}|{{{1}}}}}-{{{2}}}}}}}|{{{2}}}}}<!--
|ab={{safesubst:#invoke:ustring|sub|s1={{{1|}}}|-{{{2|}}}}}
--else-->|<!--empty, so...
|ac={{{1|}}}
--skip complex processing & return {3}-->{{{3|}}}<!--
|a=
-->}}<!--endif param. 1 not empty--></includeonly><noinclude>
|{{{3|}}}}}</includeonly><noinclude>
{{distinguish|Template:Str_right}}
{{documentation}}
返回右起的n个字符。
 
例子:
* <code><nowiki>{{str rightc|这是一个不是很长的示例句子|7}}</nowiki></code> &rarr; {{str rightc|这是一个不是很长的示例句子|7}}
* <code><nowiki>{{str rightc|这是一个不是很长的示例句子|1}}</nowiki></code> &rarr; {{str rightc|这是一个不是很长的示例句子|1}}
* <code><nowiki>{{str rightc|这是一个不是很长的示例句子|0}}</nowiki></code> &rarr; {{str rightc|这是一个不是很长的示例句子|0}}
* <code><nowiki>{{str rightc|这是一个不是很长的示例句子|99}}</nowiki></code> &rarr; {{str rightc|这是一个不是很长的示例句子|99}}
----
代码引自[[enwiki:Template:Str_rightc]]
[[分类:辅助模板]]
</noinclude>
</noinclude>

2026年1月22日 (四) 17:12的最新版本

模板文档  [创建] [刷新]