الگو:Str right: تفاوت بین نسخهها
جز (Changed protection level of Template:Str right: Highly visible template: RFPP request ([Edit=Require template editor access] (indefinite) [Move=Require template editor access] (indefinite))) |
جز (۱ نسخه واردشده) |
||
(یک نسخهٔ میانیِ همین کاربر نمایش داده نشده است) | |||
سطر ۱: | سطر ۱: | ||
− | <includeonly>{{{{{|safesubst:}}}#ifexpr: {{{2|0}}} < 0 | + | <includeonly>{{{{{|safesubst:}}}#ifexpr: {{formatnum:{{{2|0}}}|R}} < 0 |
|{{{1}}} | |{{{1}}} | ||
− | |{{{{{|safesubst:}}}#ifexpr: {{{2|0}}}+1 > {{{{{|safesubst:}}}#invoke:String|len|s={{{1}}}}} | | | + | |{{{{{|safesubst:}}}#ifexpr: {{formatnum:{{{2|0}}}|R}}+1 > {{{{{|safesubst:}}}#invoke:String|len|s={{{1}}}}} | | |
− | {{{{{|safesubst:}}}#Invoke:String|sub|s={{{1}}}|{{{{{|safesubst:}}}#expr:{{{2|0}}}+1}}|nocategory={{{nocategory|}}}}} }} | + | {{{{{|safesubst:}}}#Invoke:String|sub|s={{{1}}}|{{{{{|safesubst:}}}#expr:{{formatnum:{{{2|0}}}|R}}+1}}|nocategory={{{nocategory|}}}}} }} |
}}</includeonly><noinclude> | }}</includeonly><noinclude> | ||
− | {{ | + | {{توضیحات}} |
</noinclude> | </noinclude> |
نسخهٔ کنونی تا ۳ مارس ۲۰۱۸، ساعت ۱۶:۲۰
Uses Lua: |
محتویات
Usage
-
{{str right|<string>|<offset>}}
Gives the characters from <offset> to the end of the string.
A negative <offset> is treated the same as zero, which simply returns the original string.
If <offset> is longer than <string> then this returns an empty string.
If <offset> is invalid, empty or undefined, this template goes berserk, so please avoid.
Examples
-
{{str right |Lorem ipsum dolor sit amet |10}}
→ m dolor sit amet -
{{str right |Lorem ipsum dolor sit amet |1}}
→ orem ipsum dolor sit amet -
{{str right |Lorem ipsum dolor sit amet |0}}
→ Lorem ipsum dolor sit amet -
{{str right |123456789.123456789.123456789.123456789.123456789.123456789.123456789.123456789.123456789.123456789.1 |99}}
→ .1
TemplateData
This is the TemplateData documentation for this template used by VisualEditor and other tools; see the monthly error report for this template.
TemplateData for Str right
Gives the characters from <offset> to the end of the string.
پارامتر | توضیحات | نوع | وضعیت | |
---|---|---|---|---|
String | 1 | The string to be trimmed
| رشته | ضروری |
Count | 2 | The index of the character to trim from. Negative values are treated as 0, see {{str rightc}} to trim the right n characters. If its greater than the string length returns the empty string.
| شماره | ضروری |
See also
- {{str rightc}}
- {{str rightmost}}
- {{str left}}
The above documentation is transcluded from الگو:Str right/doc. (edit | history) Editors can experiment in this template's sandbox (create | mirror) and testcases (create) pages. Please add categories to the /doc subpage. Subpages of this template. |