打开/关闭菜单
1680
2.2万
6525
11.7万
舰R百科
打开/关闭外观设置菜单
打开/关闭个人菜单
未登录
未登录用户的IP地址会在进行任意编辑后公开展示。

舰R百科是靠无数志愿编辑者持续地建设更新完善的。编辑非常简单,无需代码知识,请勇于更新页面!
编辑入门 | 资助百科 | 留言讨论页 | 微博@舰R百科 | 百科编辑讨论Q群:366818861

模板:Str rightc/doc:修订间差异

舰R百科,玩家自由编辑的战舰少女R百科
创建页面,内容为“{{Documentation subpage}} <!----PLEASE ADD CATEGORIES WHERE INDICATED AT THE BOTTOM OF THIS PAGE----> == Usage == : {{tlx|str rightc|<string>|<count>}} : {{tlx|str...”
 
以“<!--Delete Please-->”替换内容
 
第1行: 第1行:
{{Documentation subpage}}
<!--Delete Please-->
<!----PLEASE ADD CATEGORIES WHERE INDICATED AT THE BOTTOM OF THIS PAGE---->
== Usage ==
 
: {{tlx|str rightc|<string>|<count>}}
: {{tlx|str rightc|<string>|<count>|<result if empty>}}
 
Gives a substring of length <count> characters from the right-side end of the string, or, if provided, returns <result if empty> when string is empty.
 
===Examples===
* <code><nowiki>{{str rightc |Lorem ipsum dolor sit amet |10}}</nowiki></code> &rarr; {{str rightc |Lorem ipsum dolor sit amet |10}}
* <code><nowiki>{{str rightc |Lorem ipsum dolor sit amet |1}}</nowiki></code> &rarr; {{str rightc |Lorem ipsum dolor sit amet |1}}
* <code><nowiki>{{str rightc |Lorem ipsum dolor sit amet |0}}</nowiki></code> &rarr; {{str rightc |Lorem ipsum dolor sit amet |0}}
* <code><nowiki>{{str rightc | |1 |string is empty}}</nowiki></code> &rarr; {{str rightc | |1 |string is empty}}
* <code><nowiki>{{str rightc |123456789.123456789.123456789.123456789.123456789.123456789.123456789.123456789.123456789.123456789.1  |99}}</nowiki></code> &rarr; {{str rightc |nocategory=true |123456789.123456789.123456789.123456789.123456789.123456789.123456789.123456789.123456789.123456789.1  |99}}
 
== TemplateData ==
 
{{TemplateDataHeader}}
<templatedata>
{
        "description": "Gives the right most <count> characters of a string.",
        "params": {
                "1": {
                        "label": "String",
                        "description": "The string to be trimmed",
                        "type": "string",
                        "required": true
                },
                "2": {
                        "label": "Count",
                        "description": "The number of characters from the right to return",
                        "type": "number",
                        "required": true
                },
                "3": {
                        "label": "result if empty",
                        "description": "The result if the string is empty",
                        "type": "string",
                        "required": false
                }
        }
}
</templatedata>
 
== See also ==
* {{tl|str right}}
* {{tl|str rightmost}}
* {{tl|str left}}
 
{{String-handling templates |trim}}
 
<includeonly>
<!----CATEGORIES BELOW THIS LINE, PLEASE:---->
[[Category:String manipulation templates]]
</includeonly>