Шаблон:Str right
{{#ifeq:str right |док
|
{{#ifeq:show |show
|| Ово је документациона подстраница за Шаблон:Str right. Садржи информације о коришћењу, категоријама и другом садржају који није део оригиналне странице. |
}}{{#if: |
| {{#ifexist:Шаблон:Str right
| [[Категорија:Документација {{#switch:Шаблон |Шаблон=шаблона |Модул=модула |Корисник=корисничких страница |#default=Википедије}}]]
|
}}
}}
|
}}
| Ovaj šablon pokreće Lua: |
Usage
{{{{#if: |замени:}}str right{{#if:<string> ||<string>}}{{#if:<offset> ||<offset>}}{{#if: ||{{{4}}}}}{{#if: ||{{{5}}}}}{{#if: ||{{{6}}}}}{{#if: ||{{{7}}}}}{{#if: ||{{{8}}}}}{{#if: ||{{{9}}}}}{{#if: ||{{{10}}}}}{{#if: ||{{{11}}}}}{{#if: ||{{{12}}}}}{{#if: ||{{{13}}}}}{{#if: ||{{{14}}}}}{{#if: ||{{{15}}}}}{{#if: ||{{{16}}}}}{{#if: ||{{{17}}}}}{{#if: ||{{{18}}}}}{{#if: ||{{{19}}}}}{{#if: ||{{{20}}}}}{{#if: ||...}}}}
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}}→ {{safesubst:#ifexpr: 10 < 0
|Lorem ipsum dolor sit amet |{{safesubst:#ifexpr: 10+1 > 26 | | Lorem ipsum dolor sit amet }} }}
{{str right |Lorem ipsum dolor sit amet |1}}→ {{safesubst:#ifexpr: 1 < 0
|Lorem ipsum dolor sit amet |{{safesubst:#ifexpr: 1+1 > 26 | | Lorem ipsum dolor sit amet }} }}
{{str right |Lorem ipsum dolor sit amet |0}}→ {{safesubst:#ifexpr: 0 < 0
|Lorem ipsum dolor sit amet |{{safesubst:#ifexpr: 0+1 > 26 | | Lorem ipsum dolor sit amet }} }}
{{str right |123456789.123456789.123456789.123456789.123456789.123456789.123456789.123456789.123456789.123456789.1 |99}}→ {{safesubst:#ifexpr: 99 < 0
|123456789.123456789.123456789.123456789.123456789.123456789.123456789.123456789.123456789.123456789.1 |{{safesubst:#ifexpr: 99+1 > 101 | | 123456789.123456789.123456789.123456789.123456789.123456789.123456789.123456789.123456789.123456789.1 }} }}
TemplateData
TemplateData за Str right
}} <templatedata> {
"description": "Gives the characters from <offset> to the end of the string.",
"params": {
"1": {
"label": "String",
"description": "The string to be trimmed",
"type": "string",
"required": true
},
"2": {
"label": "Count",
"description": "The index of the character to trim from. Negative values are treated as 0, see {{#if:|{{{1}}}|}} to trim the right n characters. If its greater than the string length returns the empty string.",
"type": "number",
"required": true
}
}
} </templatedata>
See also
- {{str rightc}}
- {{str rightmost}}
- {{str left}}