|
|
| (未显示另一用户的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> → {{str rightc|这是一个不是很长的示例句子|7}}
| |
| * <code><nowiki>{{str rightc|这是一个不是很长的示例句子|1}}</nowiki></code> → {{str rightc|这是一个不是很长的示例句子|1}}
| |
| * <code><nowiki>{{str rightc|这是一个不是很长的示例句子|0}}</nowiki></code> → {{str rightc|这是一个不是很长的示例句子|0}}
| |
| * <code><nowiki>{{str rightc|这是一个不是很长的示例句子|99}}</nowiki></code> → {{str rightc|这是一个不是很长的示例句子|99}}
| |
| ----
| |
| 代码引自[[enwiki:Template:Str_rightc]]
| |
| [[分类:辅助模板]]
| |
| </noinclude> | | </noinclude> |