Template:Str rightc/doc: Difference between revisions
Template page
More actions
from https://secure.wikimedia.org/wikipedia/en/w/index.php?title=Template:Str_rightc/doc&oldid=400090880 |
code instead of tt tag |
||
| (One intermediate revision by one other user not shown) | |||
| Line 1: | Line 1: | ||
{{ | {{TemplateBox | ||
<!-- | |1 = 1 | ||
|1label-en= string | |||
|1d-en = The string to return the rightmost characters of | |||
|1aliases = <!-- List of aliases, separated by / (a slash) --> | |||
|1type = <!-- number, string, string/wiki-user-name, string/wiki-page-name, string/line; unknown --> | |||
|1def = <!-- default value for the parameter --> | |||
|1stat = optional | |||
=== | |2 = 2 | ||
|2label-en= count | |||
|2d-en = The number of characters to return | |||
|2aliases = | |||
|2type = number | |||
|2def = | |||
|2stat = required | |||
|3 = 3 | |||
|3label-en= default | |||
|3d-en = Result if string is empty | |||
|3aliases = | |||
|3type = | |||
|3def = | |||
|3stat = optional | |||
|name = Str rightc | |||
|desc-en = This template gives a substring of length <count> of characters from the right-side end of the string. If the parameter 1 <string> is empty, then immediately returns with parameter 3 (or nothing), and skips all the complex processing usually needed to extract a substring. | |||
|usage-notes = | |||
: <code>{{Tlx|Str rightc|<string>|<count>}}</code> | : <code>{{Tlx|Str rightc|<string>|<count>}}</code> | ||
: <code>{{Tlx|Str rightc|<string>|<count>|<result if empty>}}</code> | : <code>{{Tlx|Str rightc|<string>|<count>|<result if empty>}}</code> | ||
|namespace = | |||
|usergroup = | |||
|shorthand = | |||
|mustbesubst = | |||
|setscats = | |||
|placement = | |||
|example = | |||
|example-value = | |||
|relieson = | |||
* {{tl|str sub long}} | |||
* {{tl|str len}} | |||
* {{tl|max}} | |||
|seealso = {{String templates see also}} | |||
|print = | |||
|type = | |||
|i18n-method = - | |||
|i18n-desc = | |||
|i18n-subpage = | |||
|i18n-mediawiki-msg = | |||
|useTemplateData = only | |||
}} | |||
== Examples == | |||
*<code><nowiki>{{Str rightc| lorem ipsum dolor sit amet | 10 }}</nowiki></code> → {{Str rightc| lorem ipsum dolor sit amet | 10 }} | |||
*<code><nowiki>{{Str rightc| lorem ipsum dolor sit amet | 1 }}</nowiki></code> → {{Str rightc| lorem ipsum dolor sit amet | 1 }} | |||
*<code><nowiki>{{Str rightc| lorem ipsum dolor sit amet | 0 }}</nowiki></code> → {{Str rightc| lorem ipsum dolor sit amet | 0 }} | |||
*<code><nowiki>{{Str rightc| | 1 | empty }}</nowiki></code> → {{Str rightc| | 1 |empty }} | |||
*<code><nowiki>{{Str rightc |123456789.123456789.123456789.123456789.123456789.123456789.123456789.123456789.123456789.123456789.1 | 99}}</nowiki></code> → {{Str rightc |nocategory=true |123456789.123456789.123456789.123456789.123456789.123456789.123456789.123456789.123456789.123456789.1 | 99}} | |||
<includeonly> | <includeonly> | ||
<!-- CATEGORIES | <!-- CATEGORIES HERE, THANKS --> | ||
[[Category:String manipulation templates]] | [[Category:String manipulation templates]] | ||
</includeonly> | </includeonly> | ||